Search Unity

Monodevelop Unityengine.dll and mscorlib

Discussion in 'Scripting' started by Kemical, Oct 18, 2010.

  1. Kemical

    Kemical

    Joined:
    Oct 4, 2010
    Posts:
    24
    Hi, i've just upgraded my unity 2.6 pro version to unity3 pro and a strange case is happening with the bundled monodevelop version.

    First of all, i've uninstall unity 2.6, an old version of mono and installed mono 2.6.3 and then installed unity 3.0.
    (I've had already installed .NET framework 3.5)

    When i make a new solution in the monodevelop installed with unity everything is fine untill i add Unityengine.dll in references, then monodevelop says "build successfull" everytime i build the solution even if i have syntax error everywhere and no dll is built.

    The only clue i have is when i open Unityengine.dll in the assembly browser of monodevelop, i see in its references :
    Code (csharp):
    1. Can't load:mscorlib, Version=2.0.5.0, Culture =neutral, PublicKeyToken=7cec85d7bea7798e
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you can not compile applications from mono. mono only acts as editor and debugger but unity, as in U2, will only work as application on its own, it will not work for you as usage library in a .net / mono project at all
     
  3. Kemical

    Kemical

    Joined:
    Oct 4, 2010
    Posts:
    24
    I'm not trying to compile an application in monoDevelop but only a .dll that i import in unity Assets afterwards. When we were using Unity 2.6 and monoDevelop 2.2, we did this and it worked perfectly.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    ah thats the prob.
    Well I would guess that the problem is on a similar scale as back then: unity uses an own mono framework, so your global one used by monodevelop might interfer unless you set the stuff correspondingly.
     
  5. Kemical

    Kemical

    Joined:
    Oct 4, 2010
    Posts:
    24
    Sorry but i didn't really understand your last reply. But i've just made an other test.
    I've installed monodevelop 2.4 and made a test solution with Unityengine.dll in reference, and it compiles without any problem.

    So the problem occurs only in the monodevelop bundled with unity...

    Any idea? :/
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    its a special modified version of it, so it might very well be that it does explicitely use stuff and not use stuff you would require.
     
  7. Kemical

    Kemical

    Joined:
    Oct 4, 2010
    Posts:
    24
    New tests again :

    Monodevelop bundled with unity with "mono soft debugger support for unity" addin disabled => compilation works
    Monodevelop 2.4 outside unity with "mono soft debugger support for unity" addin enabled => compilation does't work anymore
     
    mcroswell likes this.
  8. brad_ict

    brad_ict

    Joined:
    Sep 14, 2010
    Posts:
    69
    Reproduced this. Didn't have any autocompletion. Disabled the Add-In and now I get auto-completion.
     
  9. mcroswell

    mcroswell

    Joined:
    Jan 6, 2010
    Posts:
    79
    @Kemical: Did you ever report this as a bug to Unity? Regardless, I really appreciate you publishing this - even so many years ago. This behaviour is still happening - and your fix still works (just did this with the beta 4.6)! The new docs have a "suggestion" area and I think I will add try to suggest this "fix". It is crazy though, how it won't even report an error but just doesn't create the output DLL! :)

    Again: Thanks very, very much, for sharing how disabling the "Mono Soft Debugger Support For Unity" actually allows one to use the UnityEngine.DLL (and UnityEditor.DLL) and therefore create a custom MonoBehaviour based DLL in MonoDevelop.

    I'm adding a screen shot for those that might want to see Kemical's solution:

    upload_2014-8-29_1-12-36.png