ses*_*ker 5 .net asp.net sitecore
在我们更新Newtonsoft.Json之后,我们遇到了程序集冲突.我无法理解错误中引用的特定版本来自何处.web.config中没有任何内容指向特定版本.
System.IO.FileLoadException:无法加载文件或程序集"Newtonsoft.Json,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 30ad4fe6b2a6aeed"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040)
GAC的两个版本的装配会解决这个问题吗?
Sea*_*ney 17
正如@jammykam在marto的回答中评论的那样,你可以重定向程序集.过去我和Newtonsoft以及Sitecore没有遇到任何问题.您可以查看我的Sitecore内容作为服务代码,我可以使用它.
您对web.config文件中的这些行特别感兴趣:https: //github.com/HedgehogDevelopment/sitecore-content-service/blob/master/Sitecore/Web/Web.config#L3499
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.5.0.0" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
GAC 可能会起作用,但会造成维护噩梦。不要这样做!
我认为你有两个选择:
如果您不需要库的任何最新功能(如(动态...等)),我会推荐 1