.net - ASP.NET MVC 4 WebAPI PostAsJsonAsync Newtonsoft.Json error -


in mvc 4 web api project stops working. it's can't find newtonsoft.json. after running code :

 dim response httpresponsemessage = myhttpclient.postasjsonasync("api/test", myobject).result 

i message error :

an unhandled exception of type 'system.io.fileloadexception' occurred in system.net.http.formatting.dll

additional information: not load file or assembly 'newtonsoft.json, version=4.5.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040)

i know ms using default json serializer - , it’s referenced. tried update newtonsoft.json nuget can't find it; find "json.net". used package manager console reinstall

update-package newtonsoft.json –reinstall 

but still doesn’t work. have idea why going wrong?

it seems using outdated library depends on old version of json.net. try install specific version of it:

update-package newtonsoft.json -version 4.5.11 

if fails telling other package requires newer version of json.net need resolve conflict upgrading outdated library using , depends on json.net 4.5


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -