This project has moved. For the latest updates, please go here.

What's the current state of running Json.NET under Mono?

Aug 18, 2009 at 4:15 AM

I read a while back that Json.NET was being included with the Mono project.  Is that still the case?  I was just wondering the state, because I use your library inside my open source library and I plan on supporting Mono.  I ran MoMA on the Json.Net dll and it does come back with some errrors for compatibility.

Aug 18, 2009 at 9:37 AM

Never looked into it. The .NET 2.0 dll might be capable. Mono will have better support for .NET 2.0 features.


Aug 18, 2009 at 1:57 PM

I'm confused then?

Aug 18, 2009 at 9:38 PM

A version of Json.NET being used in Mono is not the same as the current version of Json.NET running on Mono...

Aug 18, 2009 at 10:02 PM

OK, then.  I guess we'll just have to see what is needed.  I will inspect more, once I get MoMA into my build process.  Would you want help with changes or would you rather me submit my findings?  BTW, the project I am using Json.NET in is called Ottoman.  Ottoman is an open-source CouchDB API for the .NET Framework written in C#.  I am not sure if you've heard of CouchDB, but you can find more information about it here:

Aug 19, 2009 at 9:05 AM

I'd be curious to know if anything doesn't work in Mono. I would hope that Mono would fix itself to work as .NET does rather than I have to make Mono specific changes.


Aug 19, 2009 at 3:24 PM

That is the goal, Mono mirrors the .NET BCL, but of course they are implemented differently and there are still some parts of the .NET BCL that's not implemented in Mono yet.  The first step is to run MoMA on the Json.NET library and see if you are using anything that isn't implemented yet, you can download the tool from here:

Here's what it gave me when I ran it:

Methods that are still missing in Mono: 3

No P/Invokes are called.

Methods called that throw NotImplementedException: 3

Methods called marked with [MonoTodo]: 3

When you run the tool on your assembly, you can get a detailed report on the above areas.  Ouch, there are three methods missing, which will crash an application if that functionality is used while running under Mono.  The three methods that throw not implemented exceptions are marked [MonoTodo] also, which is good.  This means that we can probably ignore these for the initial porting, but there may be missing functionality and your library will not crash the application using it if it comes across these method calls.  Run the tool to view the report, it will be easier than me typing the details out here.  Here's a link describing the issues that MoMA reports and what to do if you come across them:  Running the tool and submitting the results will also help prioritize the efforts of getting those methods implemented, unless you want to implement them and submit patches.