sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.04k stars 179 forks source link

Unhandled Exception in Unity 5 #52

Closed keithcollins closed 5 years ago

keithcollins commented 8 years ago

I'm not exactly sure why, but the error goes away when you click on the DLL, then change the CPU to x86 in Platform Settings, under the tab that has the Unity logo. Maybe that's just a requirement, and if so might be worth an update to the README.

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 <filename unknown>:0 
  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Missing method .ctor in assembly /Users/Keith/Code/astar-unity/Assets/C5.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
The class System.Runtime.Versioning.TargetFrameworkAttribute could not be loaded, used in C5
Can't find custom attr constructor image: /Users/Keith/Code/astar-unity/Assets/C5.dll mtoken: 0x0a0009bf
ghost commented 8 years ago

Try building the C5.Net35 version.

JnxF commented 5 years ago

It seems that it was a compatibility problem between Unity and C5's Mono target version. This should be solved with the newest C5 version.