Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by zrice03 · Apr 11, 2019 at 02:11 AM · dll error

Project lost all references to Unity dlls

Hi, all of sudden my project lost all references to the Unity dlls. In the script the "using UnityEngine;" directive says "type or namespace name 'UnityEngine' cannot be found (are you missing a using directive or assembly reference". The reference to UnityEngine.dll is in the project references, though it has a yellow triangle on it (along with a number of others).

alt text

Things I have tried:
1) Deleting Library folder and restarting Unity.
2) Deleting the .csproj and .sln files (Unity doesn't regenerate them when I open a script afterwards)
3) Uninstalling then reinstalling Unity.
4) Changing the project to the .NET 4.x framework (previously was 3.5)
5) Changing the API Compatibility Level to 4.x (previously was 2.0)
6) I can't manually add references, when I right-click the project, and go to "Add", "Add Reference" is not an option.
7) I can't edit the reference itself, the path is blank and grayed out.

alt text

I didn't upgrade Unity, it was working fine one day, and the next day it was just broken. And it's nothing to do with git or other version control (not using them. yeah yeah, yell at me about that some other time...). Don't know what else the problem could be.

refs.png (7.4 kB)
refs.png (14.5 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zrice03 · Apr 11, 2019 at 02:13 AM 0
Share

I also can't access the project Properties in VS. When I right-click the project -> Properties, there's just a flash like it opens then immediately closes.

avatar image zrice03 · Apr 13, 2019 at 10:17 PM 0
Share

I started a new project and it has the same problem. This has to be a bug. It completely hoses EVERYTHING.

avatar image zrice03 · Apr 13, 2019 at 10:35 PM 0
Share

Also tried adding a Plugins folder and directly pasting UnityEngine.dll into it. It created a .meta file, but nothing else. Even deleted the UnityEngine reference in VS and reloaded Unity/VS, still no dice.

avatar image Bunny83 · Apr 14, 2019 at 12:19 AM 0
Share

Where's your project located? maybe you stored it in a problematic location that gives you issues with permissions or readonly settings? Also make sure you do NOT start Unity with ad$$anonymous$$istrator rights. This creates much more issues than it may seem to solve.


Apart from that the VS project is completely irrelevant for Unity. It's only there for convenience inside your code editor (Visual Studio). I'm not saying that is doesn't matter since it's annoying when code completion doesn't work. However there's nothing we can do about your issues. There are just too many potential things that could go wrong on your side. In almost all cases where people said "something suddenly happend" they just didn't pay attention to what they actually did which caused the issue. Often it might be something see$$anonymous$$gly unrelated (installing / updating antivirus software, moving the project from one location to another, ...)

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by mattmsty · Oct 22, 2020 at 04:42 AM

This happened to me after the latest update. I fixed my issue by opening Assembly-CSharp.csproj with a text editor, and manually fixing the hintpaths. For some reason, they didn't update when I updated my project.

For example, I had to change:

   <HintPath>C:\Program Files\ **2019.3.14f1** \Editor\Data\Managed\UnityEngine\UnityEngine.dll</HintPath>


to:

   <HintPath>C:\Program Files\ **2020.1.10f1** \Editor\Data\Managed\UnityEngine\UnityEngine.dll</HintPath>







Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by rosssssss · Jul 29, 2019 at 04:18 PM

This happened to me and it turned out that i had accidentally created a new "Assembly Definition" in the assets somewhere (in my case amongst the scripts.) Deleting this accidentally made thing and everything went back to normal hurray.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ImperialDynamics · Jul 15, 2020 at 08:15 AM

it happens from time to time. Noone knows why. It's by faaar the single most annoying thing about Unity. Your project works fine. You turn off your PC, the following day you open the exact same project unmodified and Unity throws hundreds of errors. If anyone in Unity reads this forums we'd like to have an explanation AND A LONG-OVERDUE FIX!!!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by lodendsg · Jan 25, 2021 at 11:12 AM

This is still an issue with Unity We have seen this various times in the past, this most recent time it was an upgrade from 2020.2.1f to 2020.2.2f.

For us the quickest way to fix it is to remove all the csproj and sln files then try to open a script. Unity should see its missing and rebuild them.

I sware there used to be a button in the Edit menu for Rebuild Solution files ... or maybe that was something we created.

@Unity This issue has been a intermitent issue for years. Its usually trivail to fix if your comfortable with VS and Unity but for many this is the point they threw Unity out in favor of UE or something else. Please fixing this should be as simple as on start up or double click of a script to start proc VS confirming the references of the projects are correct for the version of the editor your runing.

PS: a better forum would be nice to :) I shouldn't have to type <br> to add some minor white space.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

172 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why I get a generate error? 1 Answer

MS SQL Database and System.Data dll 2 Answers

I upgraded to Unity 2019.3.7 from 2018.4.0. Firebase cannot found dll. Below is the error which appears on pressing Play button. 0 Answers

How do I set up 5DT gloves in Unity 5.4.1? 1 Answer

C/C++ Dll not found while installing APK in HMT-1 device 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges