.Net 4.5/MVC/WebAPI RC and the missing JsonArray

 

Before the RC release of MVC4/WebAPI JsonArray and JsonObject lived in System.Runtime.Serialization.  Once you upgrade your project these options disappear.

The fix is pretty simple.  In the latest RC release of MVC4/WebApi Microsoft switched the JSON handler to JSON.NET

The project should have a reference to Newtonsoft.Json (if it does not, you might need to load the NuGet package.

Once this is complete add a using statement

using Newtonsoft.Json.Linq

After that you can now use:

  • JArray in place of JsonArray
  • JObject in place of JsonObject
  • so on and so forth.
Advertisement
This entry was posted in MVC, Web and tagged , , . Bookmark the permalink.

1 Response to .Net 4.5/MVC/WebAPI RC and the missing JsonArray

  1. Mike Jones says:

    Thanks for the explanation. So far you’re the only place on the web to provide one.

Comments are closed.