Reputation: 183
I am getting an error with NewtonSoft JSON when I try to build my application.
Error 4 Assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' which has a higher version than referenced assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
Please help me in resolving this.
Upvotes: 5
Views: 3894
Reputation: 183
All I did was edited the csproj file, by identifying the versions there were two versions of NewtonSoft I removed one of the version from the csproj and saved the file. It got fixed.
Upvotes: 0
Reputation: 156958
Change your project to reference to JSON.NET version 6 since you use another dependency (System.Web.Http
) that needs it. You can't use two versions of the same assembly in one project.
You can get the latest version (6) using NuGet. Run this in your package manager console:
PM> Install-Package Newtonsoft.Json
Upvotes: 10