加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在仅具有Oracle 12c的计算机上托管使用Oracle 11g的ASP.NET

发布时间:2020-12-12 13:15:13 所属栏目:百科 来源:网络整理
导读:我的ASP.NET应用程序在 Windows Server 2008 R2服务器上运行.已安装Oracle 11g. 我将此应用程序部署到Windows Server 2016服务器. Oracle 12c安装在此服务器中(不支持11g). 当我运行该应用程序时,我收到此错误: Could not load file or assembly Oracle.Dat
我的ASP.NET应用程序在 Windows Server 2008 R2服务器上运行.已安装Oracle 11g.

我将此应用程序部署到Windows Server 2016服务器. Oracle 12c安装在此服务器中(不支持11g).

当我运行该应用程序时,我收到此错误:

Could not load file or assembly Oracle.DataAccess

如果我将Oracle 11g dll(Oracle.DataAccess.dll)复制到应用程序的bin文件夹,我会看到以下消息:

The provide is not compatible with the version of Oracle client

有没有办法在不安装Oracle 11g或更改应用程序代码的情况下运行此应用程序?

enter image description here

解决方法

如果我理解你的应用程序链接到Oracle.DataAccess.dll的11gR2 DLL.

你能检查路径中的dll版本(可能在GAC中,但并非总是如此)?

您在Web.config的这一部分中有什么(从我的网站上取样)?这与您路径中的dll匹配吗? :

<runtime>
    <!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
    <legacyHMACWarning enabled="0" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <!-- Oracle -->
        <dependentAssembly>
            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89B483F429C47342" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.65535.65535.65535" newVersion="4.122.1.0" />
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
            <bindingRedirect oldVersion="4.0.0.0 - 4.65535.65535.65535" newVersion="4.122.1.0" />
        </dependentAssembly>

上面我将驱动程序的所有版本重新映射到我服务器上安装的驱动程序.它通常可以正常工作,除非你主动使用只存在于“up”版本中的东西.

请务必检查您的DLL的版本(上面的版本是12.2驱动程序).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读