简体   繁体   中英

Microsoft.WindowsAzure.Storage.StorageException Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0,

I've encountered one run-time exception when running Azure Worker Job on my local machine. The detailed error information is as follows.

An unhandled exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.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've tried almost all the methods on stackoverflow about Newtonsoft.Json issue, but none of them works. And I've tried to search over all the project in my solution, but none of them have reference to Newtonsoft.Json 6.0.0.0. In my project, I use the latest version of Newtonsoft.Json 8.0.3. Does anyone has encountered similar issue?

I ran into this issue yesterday morning and a co-worker of mine finally found the solution. Turns out what had happened was that I had tried to incorrectly publish some files from one of our other projects into a location that was using newtonsoft.json references and the .dlls that I had publish included a reference to something involving version 6.0.0 even though the referenced assembly was version 9.0.1 and we included a binding redirect in the app.config to move everything to 9.0.0.

Long story short, if you know all the locations in which you have newtonsoft.json installed and you can remove all your local .dlls and get the last working version from your server, try doing that first and seeing if you can compile/run then try upgrading the associated projects through the Nuget package UI manager.

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM