Eric Sun
Eric Sun

Reputation: 11

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?

Upvotes: 1

Views: 1556

Answers (1)

Xanwind
Xanwind

Reputation: 11

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.

Upvotes: 1

Related Questions