如何使用与我构建的版本不同的 ODP.NET 版本?

发布于 2024-08-13 22:29:40 字数 162 浏览 5 评论 0原文

我有一个使用 ODP.NET 2.111.6.20 构建的应用程序 - VS 中的所有引用都将特定版本设置为 false,但是当我尝试在只有 2.111.6.0 的计算机上运行该应用程序时,它会抛出错误说找不到 2.111.6.20 程序集。如何让我的应用程序在任何版本的 ODP.NET 2.111 上运行?

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 machine 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

地狱即天堂 2024-08-20 22:29:40

我想程序集是强签名的,所以你会得到例外。您可以在 app.config 文件中使用 绑定重定向

<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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文