- Home /
The question is answered, right answer was accepted
Json.net Could not load type from assembly
I have been using Json.net for a while in my project with no problem.
However today I've tried to create a custom JsonConverter. Now, Unity throws the error:
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type 'Newtonsoft.Json.Linq.JContainer' from assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
The odd thing is that I can access JContainer just fine from Monodevelop.
I am using the Json.net dll compiled for .Net 2.0, so that shouldn't be an issue.
I have been trying to fix it for quite a while now and it is driving me crazy.
Any help is appreciated.
Answer by angarg12 · Jun 22, 2014 at 07:33 PM
After two wasted evenings I finally fixed this error.
I will need to do extensive testing another day but it seems to work.
I got the answer from here:
http://json.codeplex.com/workitem/25220
Basically you need to make sure that:
a) You are using the .NET 2.0 version of the dll. b) In Edit -> Project settings -> player -> other settings, set API compatibility level from .NET 2.0 subset to .NET 2.0.
I hope nobody else gets stuck on this!
It's not wasted evenings if you've helped out a load of anonymous internet people! Cheers.
Follow this Question
Related Questions
ERROR:Multiple precompiled assemblies with the same name Newtonsoft.Json.dll 0 Answers
How to create a TextAsset in a ScriptedImporter? 2 Answers
Move Character from Json input and Wait 0 Answers
How do i best describe an object with modular components in Json or other text? 1 Answer
Object to JSON Conversion 2 Answers