- Home /
The question is answered, right answer was accepted
Build error when using BooleanOps.dll
I'm using BooleanOps.dll durng runtime to cut mesh and everything works in editor but when i try to build i get this error
Error building Player: Extracting referenced dlls failed.
ArgumentException: The Assembly UnityEditor is referenced by BooleanOps. 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:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:137)
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:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:140)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:172)
UnityEditor.HostView:OnGUI()
Answer by vexe · Feb 15, 2015 at 10:34 PM
The UnityEditor.dll is not available for you at runtime when you build and run your game. Your custom dll seems to be referencing it so it errors out cause it's not finding it. You could use conditional compilation and wrap any usage of editor codes with #if UNITY_EDITOR ex:
#if UNITY_EDITOR
using UnityEditor;
#endif
// ... somewhere else
#if UNITY_EDITOR
// some editor codes...
#endif
I've also wondered about that, but if you think about it, it doesn't make sense. There's no 'unity editor' in your game... Even if you manage to add it in build somehow, you might crash using it.
What is it anyway in the editor dll that you want in your game that much? - is it something maybe you could implement? - if not, is it maybe something you could grab from the dll after decompiling it? (assu$$anonymous$$g it doesn't have much dependencies on other editor code)
Its boolean operator that allows me to cut holes in meshes, witch is kinda important in my prison escape game