This project has moved and is read-only. For the latest updates, please go here.

Porting to Mono

Dec 3, 2009 at 8:03 PM

I was wondering if you had any plans to target Mono at any point in the future, having analysed your code with the MoMA (Mono Migration Analyser) tool there aren't many changes that would need making so would you consider doing this in the future?

If not are you open to me sending you patches which would permit this portability when I have time to do so?

I'm asking since I'm looking at porting my own open source API to Mono for future releases and JSON.Net is one of the libraries I currently have dependencies on.


Rob Vesse

Dec 6, 2009 at 11:19 PM

The latest .NET 2.0 version of Json.NET built from the source code on CodePlex should be 100% compatible with Mono.

Dec 7, 2009 at 11:32 AM

Ideally I'd rather use the latest .Net 3.5 builds of Json.Net seeing as my own API is .Net 3.5

Just ran MoMA on the .Net 2.0 build and it flags up an issue with that build still, though it's not that affects my usage of Json.Net as far as I can tell

Dec 7, 2009 at 9:04 PM

Mono's .NET 3.5 version still has holes. I'd rather Mono catch up than I have yet another release targeting them.

I just ran the latest Json.NET 2.0 build through MoMA and it passes without error.

Dec 16, 2009 at 9:59 AM

Mono 2.6 has just been released and I have run the test tool again Json.NET. No errors :)

Dec 17, 2009 at 9:12 AM

Yeah I already got my library building under Mono 2.6 before you'd posted that, thanks for taking the time to check it out.

I'm going to be targeting Mono 2.6 for when I officially release a Mono build since Mono 2.4 misses one of the important classes from .Net 3.5 that I need (ReaderWriterLockSlim) and the C# compiler in the 2.4.3 release doesn't compile my code since it has a bug which they have fixed in 2.6 after I reported it a couple of weeks ago.


Jan 26, 2010 at 8:11 AM

I noticed while working on a Mono port for TweetSharp that the DataContract and DateTimeOffset classes in the latest JSON.NET do in fact throw warnings in MOMA.

Jan 26, 2010 at 8:15 AM
Edited Jan 26, 2010 at 8:15 AM

More specifically, here are the warnings:


Error    1    Mono is missing the method: bool DataContractAttribute.get_IsReference()    C:\Users\Dimebrain\Desktop\Json35r6\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.cs    206    10
Error    2    Mono is missing the method: string DataMemberAttribute.get_Name()    C:\Users\Dimebrain\Desktop\Json35r6\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.cs    459    13
Error    3    Mono is missing the method: string DataMemberAttribute.get_Name()    C:\Users\Dimebrain\Desktop\Json35r6\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.cs    460    10
Error    4    Mono is missing the method: bool DataMemberAttribute.get_IsRequired()    C:\Users\Dimebrain\Desktop\Json35r6\Src\Newtonsoft.Json\Serialization\DefaultContractResolver.cs    471    10


Message    5    MonoTodo: DateTimeOffset DateTimeOffset.Parse(string, IFormatProvider, DateTimeStyles)
Reason:     C:\Users\Dimebrain\Desktop\Json35r6\Src\Newtonsoft.Json\Converters\IsoDateTimeConverter.cs    123    12    Newtonsoft.Runner





Jan 26, 2010 at 10:26 AM

I don't get errors testing 3.5r6 targeting Mono 2.6.

Jan 27, 2010 at 1:43 AM

If you say so. Those reports come directly from Mono 2.6 running Json35r6. I don't use DataContract / DataMember, so it doesn't affect me.

Jan 28, 2010 at 7:23 AM

I tried again and didn't get any MoMA errors *shrug*