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
0
Question by CoSpinu · Feb 01, 2017 at 04:00 PM · erroreditorassembly

The Assembly UnityEditor is referenced by Assembly-CSharp

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 UNITY_EDITOR
         // If we're in the editor, create the game object with hide flags set right away
         GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags(name,
  #if SHOW_HIDDEN_OBJECTS
             HideFlags.DontSave | HideFlags.NotEditable, typeof(UIDrawCall));
  #else
             HideFlags.HideAndDontSave, typeof(UIDrawCall));
  #endif
         UIDrawCall dc = go.GetComponent<UIDrawCall>();
 #else
         GameObject go = new GameObject(name);
         DontDestroyOnLoad(go);
         UIDrawCall dc = go.AddComponent<UIDrawCall>();
 #endif

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?

Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by zaneev10 · Mar 15, 2017 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.

Comment
Add comment · Show 1 · 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 zaneev10 · Mar 28, 2017 at 05:58 PM 0
Share

We were eventually able to confirm the suggested solution. Rebuild your Library if it happens again.

avatar image
0

Answer by KemojoPtr · Apr 10, 2017 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.

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 JianZ · Apr 28, 2017 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

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 MarinWebTech · Jun 08, 2017 at 08:47 AM

Having the same issue with Oculus Sample Framework (OVR) for mobile, we get this:

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. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:142) UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:179) UnityEditor.HostView:OnGUI()

The file "Assembly-CSharp.dll" is there in the Library, but it is also in the "/TEMP/Staging Area/ " but we removed that and it created it again. We're dead in the water, we have check this on various versions (5.6.0 & 5.6.1), same issues. The file built prior to importing the OVR content.

Ideas? Beuller?? Beuller??

Comment
Add comment · Show 2 · 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 jazzbach · Oct 12, 2017 at 09:50 PM 0
Share

Hello !!

I had the exact same issue as $$anonymous$$arinWebTech had (with Oculus Sample Framework OVR for mobile):

(ArgumentException: The Assembly UnityEditor is referenced by Assembly-CSharp ('Library/ScriptAssemblies/Assembly-CSharp.dll'))

I solved the problem b doing the following (the version of Unity I used was 5.6.2f1):

In the "build settings" windows (ctrl+shift+b), after selecting either "build" or "build and run", a windows appears asking to update the APIs (API Update required). This window has two options: "I made a backup. Go Ahead !" and "No thanks". When selecting "I made a backup. Go Ahead !", the dll problem arises. But, if the option "No thanks" is selected, the project compiles flawlessly !!!

alt text

In case the "API update required" doesn't show up when building the app, A backup project needs to be used ins$$anonymous$$d. This is because (i suppose) the current project has already been updated with the new API.

I don't know if this is the right solution (not updating APIs) but it's what worked for me.

screen00.png (64.3 kB)
avatar image yurrr jazzbach · Oct 12, 2017 at 09:56 PM 0
Share

Yes, pressing "No Thanks" seems to work. Unity for some reason prompts for API update even if API update was done already...

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

124 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

Related Questions

Unity hangs when opening a project. 0 Answers

What i can do with Type Load Exception Unity3d 0 Answers

Help getting Unite 2017 demo code to run, need to fix errors 0 Answers

different behaviors of the project in unity Editor and smart phone 0 Answers

projects corrupted: Copying assembly.....UnityEngine.TestRunner.dll' failed 2 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