- Home /
Can't build error - dll is not allowed to be included or could not be found.
I'm trying to build and run my project but I keep getting errors. I believe the errors are related to the script I'm using called Uniducial, which references a program called reacTIVision to track markers with a camera. The error I'm getting is something to do with Unity Editor and DLLs. I'm way out of my depth here. Help!? This is the error:
ArgumentException: The Assembly UnityEditor is referenced by UniducialLibrary. But the dll is not allowed to be included or could not be found. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary
2 cache) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/AssemblyHelper.cs:52) UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary
2 cache) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/AssemblyHelper.cs:55) UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/AssemblyHelper.cs:86) UnityEditor.HostView:OnGUI()
I also get these errors, but I think they're related to the above one:
Error building Player: Extracting referenced dlls failed. UnityEditor.HostView:OnGUI()
And:
Exception: Error building Player: Extracting referenced dlls failed. UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:341) UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:942) UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:923) UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:697) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:213) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:206) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:107)
Answer by Alienjesus · Apr 24, 2011 at 04:18 PM
In the end updating to a new version of some open source .NET code I was using sorted the problem out.
it's a shame people that come up with solutions never specify exactly how they solved it.. (:
Can you please let me know, how did you solve this error. I'm facing same issue with one of my dll. I'm using latest unity
For me, the fix was simply changing .NET from 2.0 (subset) to .NET 2.0.
$$anonymous$$isleading, you just bumped such an old question with a comment that is clearly not related to the question. The problem is that he has a reference to the UnityEditor namespace in any of his runtime code which is not allowed as the UnityEditor namespace can only be used inside the Unity editor. Changing the .NET compatibility level certainly won't fix that issue.
That means if you had build problems it clearly wasn't the same problem as the one presented in this question. Therefore your comment is completely misplaced here and you necro posted and bumped this question for no reason.
If you have a problem ask your own question.
Thank you Bunny83. This is the solution I needed. Removing UnityEditor namespace in my assembly worked.
Answer by QQasker · Apr 15, 2011 at 04:16 PM
you can try: file/buildsettings/playersettings/othersettings change the .net2.0 subset to .net2.0 good luck.
Thanks for the suggestion, but it didn't work. I found some people who say it has something to do with Path 1.0 in Unity 3D, but unfortunately I don't have a clue what that means, as I didn't write that script :(
By the way, I used System.Windows.Forms.dll which is included in .net framwork 2.0, so this worked for me.
Answer by haico1992 · Oct 29, 2014 at 01:58 AM
Turn off Mono, it turn out that some of my unused dll files was being used by Mono, so Unity can't delete it. Hope it work out for you
Your answer
Follow this Question
Related Questions
Error Building Player: Extracting dlls 1 Answer
DLL build issues with Unity 3 1 Answer
.DLL can't build for Windows Standalone. 0 Answers
Can't export game 3 Answers
Distribute terrain in zones 3 Answers