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.
Answer by KemojoPtr
Apr 10 at 07:40 PM
I had the same issue and removing the symbols was not an option. I closed Unity and deleted all of my project and solution files, then did an Xcode replace build and the error went away.
Also make sure that all of your code has properly been migrated. Unity 5.6 deprecated a lot of code and editor scripts don't always show compile errors in the console.
Answer by JianZ
Apr 28 at 09:45 PM
Got this problem as well, pretty sure all editor stuff guarded correctly with #if UNITY_EDITOR , had anyone report this as a bug to unity? my project size is huge, I found I can't repro the issue when I create a smaller test project
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
125 People are following this question.
movie texture error - ret!=0
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
Failed to create compiler instance