Jump to content

Anyone have success with Json.net or other Json libraries?


Recommended Posts

I'm having trouble getting Json.net (http://james.newtonking.com/json) working in my mod. I think it comes down to KSP/Unity linking against a slightly different version of System.Data.dll. Does anyone have any suggestions or pointers to another Json library. The root exception on calling a Json.net method is

Could not load file or assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.

I had success with SimpleJSON (http://wiki.unity3d.com/index.php/SimpleJSON) but it doesn't preserve type information.

Link to comment
Share on other sites

I don't think so, because you don't use Unity to compile it, but your C# compiler.

True. I just learned C# for this project so my knowledge is a little lacking. What's inside the Assembly-CSharp reference that we link in from the KSP install?

Link to comment
Share on other sites

Yeah, Unity/KSP seem to be quite particular with c# versions and libraries. Am I correct in thinking that whatever is linked into Unity and KSP is slightly non-standard, even using the c# 3.5 client profile?

Unity uses Mono, which is an open source implementation of DotNet. They use mono so they can use dotnet on mac, and linux. As far as I am aware they have most of .net 2, and 3.5 is based off the 2 framework. (4 onwards did new [awesome] things, which we sadly cannot use due to mono not implementing them [yet??]).

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...