用于 .NET 4.0 的 32 位 Oracle 客户端安装的 Oracle.DataAccess.dll?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31594085/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 09:41:37  来源:igfitidea点击:

Oracle.DataAccess.dll for .NET 4.0 in 32 bit Oracle Client install?

.netoracleenterprise-libraryodp.netgac

提问by MacGyver

Below are two paths and the files present in the installation of Oracle client 32 bit (win32_11gR2_client.zip) for .NET 2.X and 4.X. When I installed the Oracle client, I chose not to take the default in two of the windows during the Install Wizard. I chose to install the "Runtime" and I also changed the install path from c:\apps{user}\ to c:\oracle because our Oracle DBA at my organization gave me those instructions.

以下是用于 .NET 2.X 和 4.X 的 Oracle 客户端 32 位 (win32_11gR2_client.zip) 安装中存在的两个路径和文件。当我安装 Oracle 客户端时,我在安装向导期间选择不在两个窗口中采用默认设置。我选择安装“运行时”,我还将安装路径从 c:\apps{user}\ 更改为 c:\oracle,因为我们组织的 Oracle DBA 给了我这些说明。

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\ C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\OraProvCfg.exe

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\ C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess。 dll C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\OraProvCfg.exe

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\ C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\OraProvCfg.exe

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\ C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\OraProvCfg.exe

I'm interested in referencing Oracle.DataAccess.dll assembly in a .NET 4.X application. I found these instructions to add the dll file to the GAC for the 64 bit installation.

我对在 .NET 4.X 应用程序中引用 Oracle.DataAccess.dll 程序集很感兴趣。我发现这些说明将 dll 文件添加到 GAC 以进行 64 位安装。

http://devblog.rayonnant.net/2011/04/oracle-11g-r2-x64-client-with-odac.html

http://devblog.rayonnant.net/2011/04/oracle-11g-r2-x64-client-with-odac.html

Four questions.

四个问题。

1.) If I run this command (which I modified slightly for the path I have), for my 32 bit installation, what will happen?

1.) 如果我运行这个命令(我对我的路径稍作修改),对于我的 32 位安装,会发生什么?

cd C:\oracle\product.2.0\client_1\ODP.NET\bin

OraProvCfg.exe /action:gac /providerpath:C:\oracle\product.2.0\client_1\ODP.NET\bin\Oracle.DataAccess.dll

2.) How can I get a list of the contents in the GAC before I run #1?

2.) 如何在运行#1 之前获得 GAC 中的内容列表?

3.) Is this the correct command to undo #1?

3.) 这是撤消#1 的正确命令吗?

cd C:\oracle\product.2.0\client_1\ODP.NET\bin

OraProvCfg.exe /action:ungac /providerpath:C:\oracle\product.2.0\client_1\ODP.NET\bin\Oracle.DataAccess.dll

4.) Rather than adding it to the GAC, how can I generate the dll file instead? What is the correct "action" argument for that? The reason I'd like to do this is because I was not able to see the dll in the "4" folder. I only saw the dll in the "2.x" folder.

4.) 不是将其添加到 GAC,而是如何生成 dll 文件?什么是正确的“行动”论点?我想这样做的原因是因为我无法在“4”文件夹中看到 dll。我只在“2.x”文件夹中看到了 dll。

Here is the help contents of this file if interested.

如果有兴趣,这里是这个文件的帮助内容。

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4>OraProvCfg.exe

Oracle Providers for .NET Configuration Utility for .NET Framework 4 : Release 4 .112.3.0 Production on Thu Jul 23 12:09:37 2015 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

Usage: OraProvCfg /action: [/force] [/product:] [/component:] [/productversion:] [/frameworkversion:<.NET framework version>] [/providerpath:] [/verbose:] [/log:]

Example: Installing an assembly in the GAC: OraProvCfg /action:gac /providerpath:

Example: Uninstalling an assembly from the GAC: OraProvCfg /action:ungac /providerpath:

Assembly name can be specified as "Oracle.DataAccess, Version=2.111.5.10"
to uninstall a specific version of assembly.

Example: Configuring machine.config for ODP.NET: OraProvCfg /action:config /product:odp /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /force /product:odp
            /frameworkversion:v2.0.50727
            /providerpath:<Oracle.DataAccess.dll full path>

Example: Unconfiguring machine.config for ODP.NET: OraProvCfg /action:unconfig /product:odp /frameworkversion:v2.0.50727

Example: Registering ODP.NET Performance Counters: OraProvCfg /action:register /product:odp /component:perfcounter /providerpath:

Example: Unregistering ODP.NET Performance Counters: OraProvCfg /action:unregister /product:odp /component:perfcounter /providerpath:

Example: Configuring ODP.NET OraclePermission for Web Applications: OraProvCfg /action:config /product:odp /component:oraclepermission /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /product:odp /component:oraclepermission
            /frameworkversion:v2.0.50727
            /productversion:<Oracle.DataAccess.dll product version>

Example: Unconfiguring ODP.NET OraclePermission for Web Applications: OraProvCfg /action:unconfig /product:odp /component:oraclepermission /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:unconfig  /product:odp  /component:oraclepermission
            /frameworkversion:v2.0.50727
            /productversion:<Oracle.DataAccess.dll product version>

Example: Configuring machine.config for ASP.NET: OraProvCfg /action:config /product:aspnet /component: /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /force /product:aspnet
            /component:<provider name>
            /frameworkversion:v2.0.50727
            /providerpath:<Oracle.Web.dll full path>

<provider name> valid values: all, membership, profile, rolemanager,
personalization, webevent, sitemap or a combination thereof
("membership | profile", for example). Default value is all.

Example: Unconfiguring machine.config for ASP.NET: OraProvCfg /action:unconfig /product:aspnet /component: /frameworkversion:v2.0.50727

<provider name> valid values: all, membership, profile, rolemanager,
personalization, webevent, sitemap or a combination thereof
("membership | profile", for example). Default value is all.

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4>

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4>OraProvCfg.exe

Oracle Providers for .NET Framework 4 配置实用程序:第 4 版 .112.3.0 生产于 2015 年 7 月 23 日星期四 12:09:37 版权所有 (c) 2010,Oracle 和/或其附属公司。版权所有。

用法:OraProvCfg /action: [/force] [/product:] [/component:] [/productversion:] [/frameworkversion:<.NET framework version>] [/providerpath:] [/verbose:] [/log: ]

示例:在 GAC 中安装程序集:OraProvCfg /action:gac /providerpath:

示例:从 GAC 卸载程序集:OraProvCfg /action:ungac /providerpath:

Assembly name can be specified as "Oracle.DataAccess, Version=2.111.5.10"
to uninstall a specific version of assembly.

示例:为 ODP.NET 配置 machine.config:OraProvCfg /action:config /product:odp /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /force /product:odp
            /frameworkversion:v2.0.50727
            /providerpath:<Oracle.DataAccess.dll full path>

示例:为 ODP.NET 取消配置 machine.config:OraProvCfg /action:unconfig /product:odp /frameworkversion:v2.0.50727

示例:注册 ODP.NET 性能计数器:OraProvCfg /action:register /product:odp /component:perfcounter /providerpath:

示例:注销 ODP.NET 性能计数器:OraProvCfg /action:unregister /product:odp /component:perfcounter /providerpath:

示例:为 Web 应用程序配置 ODP.NET OraclePermission:OraProvCfg /action:config /product:odp /component:oraclepermission /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /product:odp /component:oraclepermission
            /frameworkversion:v2.0.50727
            /productversion:<Oracle.DataAccess.dll product version>

示例:为 Web 应用程序取消配置 ODP.NET OraclePermission:OraProvCfg /action:unconfig /product:odp /component:oraclepermission /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:unconfig  /product:odp  /component:oraclepermission
            /frameworkversion:v2.0.50727
            /productversion:<Oracle.DataAccess.dll product version>

示例:为 ASP.NET 配置 machine.config:OraProvCfg /action:config /product:aspnet /component: /frameworkversion:v2.0.50727 /providerpath:

OraProvCfg  /action:config  /force /product:aspnet
            /component:<provider name>
            /frameworkversion:v2.0.50727
            /providerpath:<Oracle.Web.dll full path>

<provider name> valid values: all, membership, profile, rolemanager,
personalization, webevent, sitemap or a combination thereof
("membership | profile", for example). Default value is all.

示例:为 ASP.NET 取消配置 machine.config:OraProvCfg /action:unconfig /product:aspnet /component: /frameworkversion:v2.0.50727

<provider name> valid values: all, membership, profile, rolemanager,
personalization, webevent, sitemap or a combination thereof
("membership | profile", for example). Default value is all.

C:\oracle\product\11.2.0\client_1\ODP.NET\bin\4>

采纳答案by MacGyver

That "gac" action depends on the file already existing in the file (providerpath is the input file for this command). So it didn't even run.

“gac”操作取决于文件中已经存在的文件(providerpath 是此命令的输入文件)。所以它甚至没有运行。

I had to download the odp.net package separately from the oracle site.

我不得不从 oracle 站点单独下载 odp.net 包。

ODAC112040Xcopy_32bit.zip (53MB)

ODAC112040Xcopy_32bit.zip (53MB)

And then I referenced the dll from here, since it wasn't included in the oracle client 32 bit install (win32_11gR2_client.zip).

然后我从这里引用了 dll,因为它没有包含在 oracle 客户端 32 位安装 (win32_11gR2_client.zip) 中。

C:\Users\{user}\Downloads\ODAC112040Xcopy_32bit\odp.net4\odp.net\bin\