Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Urgent!] Problem building with DLL

Discussion in 'Editor & General Support' started by Martin_Gonzalez, Jul 25, 2016.

  1. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    361
    I know that there are lots of posts about this but this i think its different or a bit more specific. The thing is:

    -I have 2 .dll, one for my editor script and another for my normal scripts
    -My editor .dll has as platform target Editor (dll import settings) and the other one MUST be in any because it has scripts that i'm using on the scene
    -When building it throws me this error:

    "ArgumentException: The Assembly UnityEditor is referenced by MGUILib ('Assets/MGUI/Scripts/MGUILib.dll'). But the dll is not allowed to be included or could not be found."

    MGUILib that is my normal scripts is using UnityEditor for some special behaviour BUT they are under #if UNITY_EDITOR

    it seems not to be detecting that

    -If i set my normal scripts dll to Editor platform, it compiles but then i have "missing script" message on console, if i set in any (how it should be) i cannot build.

    Do i'm missing a step?

    Thanks!
     
    Last edited: Jul 25, 2016
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    UNITY_EDITOR define only affects C# code, you're still have a reference towards UnityEditor.dll... You need to remove UnityEditor.dll reference while compiling MGUILib.dll.

    Not sure how you're compiling MGUILib.dll, if with Visual Studio, simply remove UnityEditor.dll under References in the solution explorer.
     
  3. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    361
    Thanks for answering!
    Thats was right! I had the reference of UnityEditor on my MGUILib, so i had to remove it and put under #if Unity_Editor every method that my MGUILibEditor was calling.

    Thanks a lot!