- Home /
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
I am using Unity Pro 5.3.4 and OS X 10.10.5. I suddenly started getting a System.Reflection error. I updated to 5.3.4 a couple days ago and everything was working until this morning when I got to work I was getting these errors:
The following assembly referenced from This was a file path I removed for privacy reasons/Plugins/Newtonsoft.Json.dll could not be loaded: Assembly: System.Runtime.Serialization (assemblyref_index=6) Version: 3.0.0.0 Public Key: b77a5c561934e089 The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (This was a file path I removed for privacy reasons).
Could not load file or assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The following assembly referenced from This was a file path I removed for privacy reasons/Newtonsoft.Json.dll could not be loaded: Assembly: System.Xml.Linq (assemblyref_index=5) Version: 3.5.0.0 Public Key: b77a5c561934e089 The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (This was a file path I removed for privacy reasons).
I was able to fix the errors above by putting System.Xml.Linq.dll and System.Serialization.dll in the folder with the plugin. I was not able to find these on my Mac system though. I had to copy it from an installation of Unity on Windows. It just seemed like MonoDevelop couldn't find what it was looking for. I don't know how to fix the following error.
I tried the answer here but I am not using any services and this did not work.
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in :0 at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0 at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0 at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0 at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0 at Mono.CSharp.Driver.Compile () [0x00000] in :0 at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
The class System.ComponentModel.INotifyPropertyChanging could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The class System.ComponentModel.AddingNewEventHandler could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The class JTokenReferenceEqualityComparer could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JContainer could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JObject could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JContainer could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JContainer could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JContainer could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class JPropertyList could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JObject could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JArray could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JObject could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JObject could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class Newtonsoft.Json.Linq.JProperty could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class d_4`2 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class df`2 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class d0 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class d2 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class d0 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed The class <>c_DisplayClass2 could not be loaded, used in Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
Answer by momenslythe · Apr 01, 2016 at 11:05 PM
It went away almost as mysteriously as it arrived. I copied it from one folder on another computer and put it on my desktop and it worked again... I have no idea.
Answer by phxvyper · Mar 31, 2016 at 07:46 PM
Newtsoft's JSON is known to have issues with Unity. In the package you download for Newtonsoft's JSON there should be several different builds along with the source.
I solved this issue before by using the .NET 2.0 version of Newtonsoft's JSON.
Also make sure that you're using an Api Compatibility Level of .NET 2.0 (not subset). You can do this by going to your Player Project Settings -> Standalone Settings -> Other Settings -> Optimization -> API Compatibility Level.
I had checked my .NET 2.0 version was not subset before.
I'm not sure what version of Newtsoft's JSON was used since I got it from a package from a hardware plugin I was using.
I hadn't changed anything and now it seems to be working...
Should not need to stop using subset. Subset works on Windows and iOS builds.
Answer by vishal · Aug 26, 2016 at 11:19 AM
Hi..
This issue can be resolved by re-installing unity3d.
Answer by Amon · Mar 31, 2016 at 06:18 PM
Try reading this thread. It seems it may offer a solution or a way to find a solution.
Answer by qiaosic · Nov 03, 2016 at 01:12 PM
I fix this by switching platform from WebPlayer to Android....
Your answer
Follow this Question
Related Questions
in Unity 5, how can I get/set an asset's AssetBundle assignment via scripting? 1 Answer
Why does my 32-bit dll plugin(c++) work in Unity 4 and not in Unity 5 indy (Windows 32-bit editor) 0 Answers
Problem with Unity Store Manager Login Window 0 Answers
Can I use multiple plugins in the Unity 5 32-bit editor? 2 Answers
Fallback handler could not load library error on Mac OSX Build | FreeImage .dll .dylib .bundle 0 Answers