开发者

How do I use a version of ODP.NET different to the one I built with?

开发者 https://www.devze.com 2022-12-13 01:52 出处:网络
I\'ve got an app that is built with ODP.NET 2.111.6.20 - all the references in VS are set Specific Version to false, but when I try to run the app on a ma开发者_运维问答chine that only has 2.111.6.0,

I've got an app that is built with ODP.NET 2.111.6.20 - all the references in VS are set Specific Version to false, but when I try to run the app on a ma开发者_运维问答chine that only has 2.111.6.0, it throws an error saying it can't find the 2.111.6.20 assembly. How can I get my app to run with any version of ODP.NET 2.111?


I suppose the assembly is strongly signed, so you get the exception. You could use binding redirect in your app.config file:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="ODP.NET"
                              publicKeyToken="PUT THE PUBLIC TOKEN HERE"
                              culture="neutral" />
            <bindingRedirect oldVersion="2.111.6.20"
                             newVersion="2.111.6.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>
0

精彩评论

暂无评论...
验证码 换一张
取 消