In my MVC 4 Web API project stops working. It's can't find Newtonsoft.Json. After running this code :
Dim response As HttpResponseMessage = MyHttpClient.PostAsJsonAsync("Api/Test", MyObject).Result
I get message error :
An unhandled exception of type 'System.IO.FileLoadException' occurred in System.Net.Http.Formatting.dll
Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I know that MS is using this as the default JSON serializer now - and it’s referenced. I tried to update Newtonsoft.Json from NuGet but I can't find it; I find "Json.Net". So I used package manager console to reinstall
Update-Package Newtonsoft.Json –Reinstall
But still doesn’t work. Does anyone have any idea why is this going wrong?