- Home /
TypeLoadException using custom C# Assembly
I am trying to use a custom C# assembly in my Unity (3.5.4f1) game. When running the game, I get the following error:
TypeLoadException: Could not load type 'mySDK.Intersection' from assembly 'mySDK, Version=2.5.0.5, Culture=neutral, PublicKeyToken=null'.
UnityEngine.InternalStaticBatchingUtility.Combine (UnityEngine.GameObject[] gos, UnityEngine.GameObject staticBatchRoot, Boolean generateTriangleStrips) (at C:/BuildAgent/work/d9c061b1c154f5ae/Runtime/Export/StaticBatching/CombineForStaticBatching.cs:137)
`mySDK` is the name of my C# assembly. It is compiled for the .Net 3.5 runtime.
In this library, I only expose code through an interface using the factory pattern. The class intersection has an `internal` protection level within the SDK. Nowhere do I attempt to call mySDK.Intersection or set it as a type in my Unity script.
The `Intersection` class does implement the NewtonSoft.JSON library. I have seen this question: http://answers.unity3d.com/questions/316098/typeloadexception-could-not-load-type-from-assembl.html that seems also to have a TypeLoadException with a JSON library, but there are no responses, and I am uncertain that our issues are related.
Why might this be happening?
I have solved the issue; the offending library was loading System.Windows.$$anonymous$$edia.$$anonymous$$edia3D
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Saving final score and displaying on main menu 1 Answer
null texture passed to GUI.DrawTexture 0 Answers