Search Unity

An exception of type 'System.MissingMethodException' occurred in Unknown Module.

Discussion in 'Windows' started by gv, Feb 10, 2014.

  1. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    I just upgraded from Unity 4.3.0 to 4.3.4 and now I am getting this error when I run my game:

    An exception of type 'System.MissingMethodException' occurred in Unknown Module. but was not handled in user code

    This is my line of code and I had been using Newtonsoft.Json without a problem until I upgraded...

    // Turn the JSON into C# objects
    highScoresResult = JsonConvert.DeserializeObject<HighScore[]>(rawJson);


    I have changed nothing since 4.3.0.. I have also exported to a clean directory.... Is there something new that I need to know about ? I am assuming something has changed with the WP8 plugins ??
     
  2. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    oh and i get this in the output window in Visual Studio:
    InnerException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    AdditionalInfo:Invoking System.Collections.IEnumerator::MoveNext method with argument count: 0
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    at WinRTBridge.MethodTools.InvokeMethod(Object instance, Int32 methodIndex, Object[] args)
     
  3. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    hmmm i have no idea what I have done... lots of deleting this, copying that... but it appears to work now.... wow...

    wish i knew what i actually ended up changing... still if anyone has information on what the above errors mean, then please let me know...
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,882
    It probably means that what it says - it couldn't find assembly named 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'. The full name is very important, if even one character in that string in assembly name doesn't match, it won't be able to load it.
     
  5. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    ok thanks for that.. i did go and download a new version of Json.Net from their website... so I think it was that new version I was needing.. :)
     
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,565
    You may still get the missing method exception... JSON .NET uses Type.GetTypeCode (and a few other things) that were bugged in 4.3.3 and 4.3.4, so you may have to copy the WinRTLegacy.dll from the 4.3.2 version into your 4.3.4 install to workaround the issue.
     
unityunity