I get this error and I don't understand why: ArgumentException: The Assembly UnityEditor is referenced by Assembly-CSharp ('Library/ScriptAssemblies/Assembly-CSharp.dll'). But the dll is not allowed to be included or could not be found.
I know that it means that the Assembly-CSharp.dll has some code that linking it to Editor dll, but the code that is generating this issue is this one (not an editor script):
// If we're in the editor, create the game object with hide flags set right away
GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags(name,
HideFlags.DontSave | HideFlags.NotEditable, typeof(UIDrawCall));
UIDrawCall dc = go.GetComponent<UIDrawCall>();
GameObject go = new GameObject(name);
UIDrawCall dc = go.AddComponent<UIDrawCall>();
Considering that the code is handled with #if UNITY_EDITOR, i don't see the reason why i get that error (i made the basic test #if UNITY_EDITOR1 and the build error disappeared)
This issue happens onUnity 5.5.0f3 , on a project upgraded from Unity 5.3
Any ideas how i can fix this?
Answer by zaneev10
Mar 15 at 03:31 PM
@CoSpinu Our company ran into the exact same issue this week and your solution helped. We brainstormed it and a possible solution could be to delete your Library and Temp folders and your .csproj files and let Unity rebuild them. We are under deadline trying to get a large project converted to WebGL and this rebuilding could take hours on our part. If you have a smaller project, it may be worth testing to see if changing your preprocessor directive back to #if UNITY_ENGINE and rebuilding the project works. I'm sure it will save someone a headache.
Best of luck.
We were eventually able to confirm the suggested solution. Rebuild your Library if it happens again.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
124 People are following this question.
movie texture error - ret!=0
i am trying to work with wheel collides and i am having some problems
Inconsistent line endings leads to loosing ability to activate/deactivate script and makes it not working
[RESOLVED] Error? Black Screen! I can not move anything or click on anything! pls Help!
Error Code CS1519