Tôi có một ứng dụng tham chiếu đến assembly này trong môi trường phát triển:chuyển hướng Binding thất bại - PublicKeyToken khác nhau
name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="89845dcd8080cc91" version="9.0.242.0"
Tuy nhiên, máy chủ trực tiếp chứa phiên bản cũ của thư viện này:
name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="b77a5c561934e089" version="3.2.2917.0"
Như bạn thấy PublicKeyToken khác. Tôi đã thêm 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>
nhưng tôi vẫn nhận được lỗi:
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ó cách nào để chuyển hướng đến phiên bản cũ của thư viện trong trường hợp đó?
Cảm ơn, đây là những gì tôi làm hàng ngày. Tôi thay đổi tham chiếu đến hội đồng cũ trước khi phát hành trực tiếp. Đó là một sự xấu hổ. Cảm ơn. – dragonfly