I have an application that references this assembly in development environments:
name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="89845dcd8080cc91" version="9.0.242.0"
However, live server contains old version of this library:
name="Microsoft.Data.SqlXml" culture="neutral" publicKeyToken="b77a5c561934e089" version="3.2.2917.0"
As you see publicKeyToken is different. I've added bindingRedirect to 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>
but I still get the error:
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'
Is there any way to redirect to older version of library in that case?
You can't redirect an assembly if the public key is different I am afraid, you will need to recompile against the older version and remove the redirect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With