0

I installed some frameworks

Microsoft.Owin.Host.SystemWeb
Microsoft.Owin.Security.OAuth
Microsoft.Owin.Cors

After adding these, I'm getting the following error:

Could not load file or assembly 'Newtonsoft.Json, Version=10.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)

Please guide me as to how I can overcome this issue.

Kjartan
  • 18,591
  • 15
  • 71
  • 96
ems ems
  • 13
  • 2
  • Have you installed [Newtonsoft.Json?](https://www.nuget.org/packages/Newtonsoft.Json/). Make sure you have the right version. You should be able to find it easily from the nuget package manager in visual studio too. – Kjartan Dec 17 '18 at 07:33
  • 1
    Possible duplicate of [Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'](https://stackoverflow.com/questions/22507189/could-not-load-file-or-assembly-newtonsoft-json-version-4-5-0-0-culture-neutr) – Gauravsa Dec 17 '18 at 08:36

2 Answers2

1

I came a cross this issue for some years ago and the little bastard that is creating the issue is the Microsoft.Owin.Security.OAuth.

For some reason, if no newtonsoft package is installed when installing the Owin.Security.OAuth it will install it's required version but don't automatic upgrade it's reference to a newer if you install a newer newtonsoft package.

To solve it, first, uninstall the newtonsoft package

uninstall-package Newtonsoft.Json -Force

Then reinstall it

install-package Newtonsoft.Json

Then finally, update the Microsoft.Owin.Security.OAuth package

update-package Microsoft.Owin.Security.OAuth
Marcus Höglund
  • 16,172
  • 11
  • 47
  • 69
0

via NuGet type this:

Install-Package Newtonsoft.Json -Version 10.0.2

More details here Newtonsoft.Json

bat7
  • 836
  • 1
  • 8
  • 22