Error Visual Studio Publish

186 views Asked by At

When I try to publish my site that I'm logged into, on my company's server, this error message appears:

"Error 2 Could not load the file or assembly 'Newtonsoft.Json, Version = 9.0.0.0, Culture = neutral, PublicKeyToken = 30ad4fe6b2a6aeed' or one of its dependencies. The definition of the localized assembly manifest does not match the assembly reference. (Exception of HRESULT: 0x80131040) ASPNETCOMPILER 0 0 RIDmvc"

I need help!

1

There are 1 answers

0
StackUseR On

Most of the time this error happens because of different assemblies are dependent on specific version of some other assembly. The easiest fix is to update all packages that are dependent to Newtonsoft.Json using the nuget package manager.

Go to TOOLS > NuGet Package Manager and Select Package Manager Console.

Execute the following two commands:

uninstall-package newtonsoft.json -force
install-package newtonsoft.json

Hope it should work but still if you have the same problem you can execute this in your package manager console:

Update-Package –reinstall Newtonsoft.Json

Similar posts: post-1, post-2

Refer this post and Microsoft Application Lifecycle Management.