我面臨下面無法加載文件或程序集「Newtonsoft.Json,版本= 7.0.0.0
無法加載文件或組件中的錯誤」 Newtonsoft.Json,版本= 7.0.0.0, 文化=中立,PublicKeyToken = 30ad4fe6b2a6aeed'或其 依賴項之一。找到的程序集的清單定義不符合程序集引用的 。 (異常來自HRESULT:0x80131040)
我可以看到在Web.config中
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
以下於是我改成了
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.1.0" />
</dependentAssembly>
在packeges.config我可以看到下面的條目
但我仍面臨同樣的問題。請幫忙
原因可能很多。首先:檢查輸出文件夾中的程序集,並檢查文件版本和強名稱是否符合您的期望。我懷疑強名稱版本是7.0.0.0所以更改bindingRedirect(強名稱和文件版本可能會有所不同 - 它爲Newtonsoft.Json 6. *)。 –