Json.NET for Mono?

Jun 22, 2010 at 4:24 AM

Hi There,

You don't have a port that will run on Mono do you?

I have been trying to get the source to compile under Mono but not having much luck :(

Cheers,

Dean

 

Jul 4, 2010 at 5:32 PM
Edited Jul 4, 2010 at 9:34 PM
+ 1 vote... It was not something I thought about when I decided to use JSON.Net, it would be very nice to be able to use it on Mono as well. I tried compiling the "regular" .Net 3.5 version, and also the .Net 2.0 version under Mono (MonoDevelop 2.2 in Ubuntu) for laughs: For .Net 2.0 I had to replace Linqbridge with System.Core and change the target runtime to 3.5, but even then (regardless of which version of the project I use) the compilation crashed with a StackOverflowException - it looks like the problem is related to some of the Linq stuff (the compilation crash always occurs after some Linq code warnings).
Jul 4, 2010 at 10:17 PM
UPDATE: Yay, I got the latest version of mono (2.6.3.x) and MonoDevelop (2.4.x) on Ubuntu using "BadgerPorts.org" (an unofficial maintainer of the latest Mono pre-built packages for Ubuntu), and Json.Net's main project (for .Net 3.5) compiles without issue! I actually had to comment out a couple of lines (relating to an apparently non-existent "dataMemberAttribute" variable), but I probably messed something up at some point. In any case I tested after compiling, and my application runs fine under mono in Ubuntu, serializing and deserializing with Json.Net. The downside is that I would prefer to target .Net 2.0, which on Microsoft .Net is possible - on Mono it will not be possible because the "LinqBridge" hack doesn't apply (as far as I understand). Hope this helps someone!