Yes. I think it is because you can write your own json formatter an use another library like json.net or you can use the built in xml formatter if you don’t need the json one.
I like that feature, but it really should work with a default formatter out of the box without having to manually install an extra nuget package imo. Anyways, your solution worked :) Thanks!
Dear MS: Please make System.Json a package dependency in the next version.
I just spent 4 hours trying to figure out why an unhandled exception got thrown immediately after my WebAPI methods exited. In Classic Pipeline mode, there is literally zero information to help in troubleshooting. I setup the VS debugger to watch for all
thrown exception types and attached to everything IIS-related, but nothing came up. I just had an IIS error screen with 0 diagnostic information in it. Failed Request logging didn't help either.
I ended up building a brand new ASP.NET WebForms app in classic pipeline mode, wire it up with MVC support to rule out our IoC stuff. Same problem. It wasn't until I switched that app to integrated mode that I realized the whole afternoon was spent because
System.Json wasn't referenced.
Bassanova
Member
5 Points
5 Posts
Missing System.JSON
Feb 21, 2012 09:02 AM|LINK
Hi,
I've been using WCF Web API a couple of weeks in a ASP.NET MVC 3 app, and it has been working fine. Of course, I want to update to AspNetWebApi.
I use Nuget, and to update I uninstalled everything from WebApi, then tried to install using Install-Package AspNetWebApi.
The simplest of controllers in a tutorial in this page (Product API controller) gives me a nice:
Could not load file or assembly 'System.Json, Version=4.0.0.0
Is there a reference missing in the Nuget-package, or what? Am I supposed to install JSON.NET with this?
Any help appreciated :)
SixiS
Member
50 Points
16 Posts
Re: Missing System.JSON
Feb 21, 2012 09:33 AM|LINK
You have to add the nuget package "System.Json"
Bassanova
Member
5 Points
5 Posts
Re: Missing System.JSON
Feb 21, 2012 10:01 AM|LINK
Manually? So this is missing in the AspNetWebApi nuget package dependencies-list? Really?
SixiS
Member
50 Points
16 Posts
Re: Missing System.JSON
Feb 21, 2012 11:48 AM|LINK
Yes. I think it is because you can write your own json formatter an use another library like json.net or you can use the built in xml formatter if you don’t need the json one.
Bassanova
Member
5 Points
5 Posts
Re: Missing System.JSON
Feb 21, 2012 11:52 AM|LINK
I like that feature, but it really should work with a default formatter out of the box without having to manually install an extra nuget package imo. Anyways, your solution worked :) Thanks!
sholodak
Member
34 Points
15 Posts
Re: Missing System.JSON
Feb 27, 2012 08:31 PM|LINK
Dear MS: Please make System.Json a package dependency in the next version.
I just spent 4 hours trying to figure out why an unhandled exception got thrown immediately after my WebAPI methods exited. In Classic Pipeline mode, there is literally zero information to help in troubleshooting. I setup the VS debugger to watch for all thrown exception types and attached to everything IIS-related, but nothing came up. I just had an IIS error screen with 0 diagnostic information in it. Failed Request logging didn't help either.
I ended up building a brand new ASP.NET WebForms app in classic pipeline mode, wire it up with MVC support to rule out our IoC stuff. Same problem. It wasn't until I switched that app to integrated mode that I realized the whole afternoon was spent because System.Json wasn't referenced.
www.sholo.net
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Missing System.JSON
Feb 27, 2012 09:13 PM|LINK
Yes, we'll make the package work. This is a bug in the Beta. We'll fix it in the next drop.
ASP.NET Team
@marcind
Blog
Henrik Fryst...
Member
96 Points
13 Posts
Microsoft
Re: Missing System.JSON
Mar 02, 2012 04:05 PM|LINK
There is now a fixed NuGet package which includes the System.Json dependency so next time you get the package it should work.