Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

newtonsoft.json library error

I have Asp.net WebApi project. I have added reference to Newtonsoft.json 7.0.0 in my project. But I am constantly getting an error

'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 have no reference to this library (version) anywhere in my project. In fact all the dependent libraries are using newtonsoft.json version 7.0.0 . So what is the reason for this error? This is line that is crashing.Removing this line does not help either.

HelpPageConfig.Register(GlobalConfiguration.Configuration);

Any suggestions?

like image 238
santubangalore Avatar asked May 18 '26 23:05

santubangalore


1 Answers

Could you provide more details about your project? What are the HelpPageConfig and GlobalConfiguration objects? Are they in the same project? How did you add this library to your project? Was it via NuGet Package Manager?

It seems to me that one of the units involved has a reference to an older version of NewtonSoft.

I would try to consolidate those versions via the "Manage NuGet Packages for Solution" option by right clicking your solution. This will remove older versions of the library and will keep only the version chosen in the NuGet package console.

like image 192
Matheus Da Silva Primo Avatar answered May 20 '26 12:05

Matheus Da Silva Primo