- Home /
Exclude some dlls to load when build is not PC?
Hello,
I extended my editor with a windows forms window and when compiling for PC everything is fine. But when I try to compile for android or web player, it does not compile because it seems to use the System.Windows.Forms.dll even on these devices (which obviously doesn't work and I also don't need it there, I just need it for editing some game stuff). I also included System.Data and System.Drawing.
I'm using the dlls from Unity/Editor/Data/Mono/lib/mono\2.0 (like recommended on the web)
This is the error I'm getting :
ArgumentException: The Assembly System.Configuration is referenced by System.Data. 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.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:172) UnityEditor.HostView:OnGUI()
and
Error building Player: Extracting referenced dlls failed.
It looks like it tries to load these dlls even when I don't need them. The entire class of the form is inside a #if UNITY_EDITOR
but how can I exclude these dlls from being loaded when not having PC as active build?
Your answer
Follow this Question
Related Questions
'EventSystems' does not exist in the namespace 'UnityEngine'... 1 Answer
Physics.Raycast not working on il2cpp 0 Answers
Recompiling my DLL as SO. 0 Answers
Mono and missing types using external library 2 Answers
Cross platform dlls (ios,android,pc) 0 Answers