0

My solution has two projects that reference the Newtonsoft.json.dll. I have confirmed that the package.config & app.config files contain reference to the 10.0.3 version. Still I am getting the following error,

An unhandled exception of type 'System.AggregateException' occurred in SNOnshapeImpCS.dll Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.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 tried searching similar questions on this forum but haven't been able to resolve this issue. I have already looked at this link: Assembly looking for wrong version of Newtonsoft.Json.dll

Any help would be welcome.

  • 1
    Is SNOnshapeImpCS yours? Try to clean your workspace (bin, obj in projects and packages folder) then check if your project (csproj) has reference to version 10.0.3 – Kedrzu Jan 05 '18 at 09:42
  • Also check your assembly binding redirects. Presumably one of your dependencies expects 6.0, so you need a redirect to say that it should use 10.0.3 instead. – Jon Skeet Jan 05 '18 at 09:43
  • Since your application or library is *expecting* version 6 that seems correct, yes. If you want it to use version 10 instead you need to check your references and binding redirects, somehow your application still wants version 6. – Lasse V. Karlsen Jan 05 '18 at 09:44
  • @Kedrzu Yes, SNOnshapeImpCS is my project. I did as you suggested but no success. – Nikhil Ruikar Jan 05 '18 at 11:32
  • @JonSkeet I have already confirmed that the redirects point to 10.0.3 – Nikhil Ruikar Jan 05 '18 at 11:33
  • Well it doesn't *look* like that redirection is taking effect, otherwise you wouldn't get that error. So please include your assembly binding redirects (and explain where they are, along with what kind of project you're running). If at all possible, reduce this to a [mcve] so that we can try to reproduce it for ourselves. – Jon Skeet Jan 05 '18 at 11:34
  • If you checked the binding redirects and they are ok, try manually deleting the packages and bin folders, then clean and rebuild. – Lavinia N. Jan 05 '18 at 13:31

0 Answers0