gpt4 book ai didi

c# - 绑定(bind)重定向失败 - 不同的 publicKeyToken

转载 作者:太空狗 更新时间:2023-10-29 17:49:50 25 4
gpt4 key购买 nike

我有一个在开发环境中引用此程序集的应用程序:

name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="89845dcd8080cc91" version="9.0.242.0"

但是,实时服务器包含此库的旧版本:

name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="b77a5c561934e089" version="3.2.2917.0"

如您所见,publicKeyToken 是不同的。我已将 bindingRedirect 添加到 app.config:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="3.2.2917.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

但我仍然得到错误:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass embly 'Microsoft.Data.SqlXml, Version=3.2.2917.0, Culture=neutral, PublicKeyToke n=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Data.SqlXml, Version=3.2.2917.0, Culture=neutral, PublicKe yToken=89845dcd8080cc91' ---> System.IO.FileNotFoundException: Could not load fi le or assembly 'Microsoft.Data.SqlXml, Version=9.0.242.0, Culture=neutral, Publi cKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find t he file specified. File name: 'Microsoft.Data.SqlXml, Version=9.0.242.0, Culture=neutral, PublicKey Token=89845dcd8080cc91'

在这种情况下,有什么方法可以重定向到旧版本的库吗?

最佳答案

恐怕如果公钥不同,您将无法重定向程序集,您将需要针对旧版本重新编译并删除重定向。

关于c# - 绑定(bind)重定向失败 - 不同的 publicKeyToken,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7913520/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com