如何在一台机器上同时安装 ODAC 11.2 和 12.2?

How to install both ODAC 11.2 and 12.2 in a machine?

我在不同的项目中工作,我的一个项目使用 Visual Studio 2010,另一个使用 VS 2017,另一个使用 2015。

对于 VS 2010 我已经安装 ODACT with ODT 11.2 它工作正常。但是 VS 2015 和 2017 需要 ODAC with ODT 12.2+ 所以我在我的机器上安装了 12.2 并且在 VS 2010 解决方案之后 edmx 更新根本不起作用。

这就是我收到的 Visual Studio Activity 日志

 <record>330</record>
    <time>2019/04/03 08:11:41.598</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [Oracle Developer Tools for Visual Studio]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
  </entry>
  <entry>
    <record>331</record>
    <time>2019/04/03 08:11:41.598</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [Oracle Developer Tools for Visual Studio]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    <hr>80070002</hr>
    <errorinfo>Could not load file or assembly 'Oracle.VsDevTools.10.0, Version=4.112.3.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.</errorinfo>
  </entry>
  <entry>
    <record>332</record>
    <time>2019/04/03 08:11:41.614</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [Oracle Developer Tools for Visual Studio]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo>Could not load file or assembly 'Oracle.VsDevTools.10.0, Version=4.112.3.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.</errorinfo>
  </entry>
  <entry>

我已经尝试了几种方法来解决这个问题。

  1. 两个安装使用不同的 oracle home
  2. GAC 中删除了 odp.net 相关政策。
  3. 编辑 machine.config 并更改了 odac 版本

但没有任何效果。

注意:在这两个安装中,我都使用了机器范围的安装。

安装 12.2+ 版本作为非机器范围。

Oracle.ManagedDataAccess.Client 移动到 GAC。(以 运行 管理员身份打开 VS 2010 命令提示符。然后使用 gacutil -i "path to oracle managedaccess.client dll")

然后打开命令提示符cd到主目录路径(odac 12.2安装路径)。 示例:

C:\app\client\Arunprasanth\product.1.0\client_1\odp.net\managed\x86>

然后运行下面的命令

oraProvCfg.exe /action:config /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.2.0

注意:上述步骤将在您的 machine.config 中创建一个条目。

现在您可以在 VS 2010 和 2015 中使用 ODT