Error "Could not load file or assembly 'Newtonsoft.Json or one of its dependencies" occurs every day

时间:2015-06-15 14:20:04

标签: c# .net-assembly fileloadexception

I get the following error every day:

Exception information: 
Exception type: FileLoadException 
Exception message: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.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 can temporarily fix it by renaming the dll and then reverting the rename. I've check the web config for the proper assembly redirect:

<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />

I have also checked the file assembly version number and that is 4.5.0.0 It's version 5.0.8 of the Newtonsoft.Json package.

enter image description here

How is it possible that this error keeps occurring everyday? What are the possible causes?

This problem seems to be fixed now. I manually cleaned the entire solution locally and also on the webserver. And did a clean deployment.

0 个答案:

没有答案