托管 ODP.NET 驱动程序未显示在数据源对话框中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28694919/
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:37:59  来源:igfitidea点击:

Managed ODP.NET driver does not show up in Data Source dialog

.netoraclevisual-studiovisual-studio-2013odp.net

提问by Uwe Keim

Having installed managed ODP.NET on my computer, the ODP.NET Managed Driverdoes not appear inside the Choose Data Sourcedialog in Visual Studio 2013 Professional.

在我的计算机上安装了托管 ODP.NET 后,ODP.NET 托管驱动程序不会出现在 Visual Studio 2013 Professional的“选择数据源”对话框中。

This is how it should look like:

它应该是这样的:

enter image description here

在此处输入图片说明

This is how it actually looks on my machine:

这是它在我的机器上的实际外观:

enter image description here

在此处输入图片说明

I've followed the steps described in the "An Easy Drive to .NET" article on the Oracle website.

我已按照Oracle 网站上的“轻松驱动 .NET”文章中描述的步骤进行操作。

I've also installed the Oracle Developer Tools for Visual Studio. Still no managed driver to select.

我还安装了适用于 Visual StudioOracle 开发人员工具。仍然没有可以选择的托管驱动程序。

My question:

我的问题:

Is there anything I forgot to do in order to make the data provider appear?

为了让数据提供者出现,我有什么忘记做的吗?

采纳答案by Wernfried Domscheit

Open your Registry editor and check if RegKey HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\odp.net.managedexists. It contains only the (Default) value with location of your Oracle.ManagedDataAccess.dll.

打开您的注册表编辑器并检查 RegKey 是否HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\odp.net.managed存在。它仅包含(默认)值以及 Oracle.ManagedDataAccess.dll 的位置。

Add the key in case it is missing, example:

添加密钥以防丢失,例如:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\odp.net.managed]
@="c:\oracle\product\12.1\odp.net\managed\common"

You can also try the Oracle config scripts at {ORACLE HOME}\odp.net\managed\x64\configure.batand {ORACLE HOME}\odp.net\managed\x86\configure.bat, they should do the same

您也可以在{ORACLE HOME}\odp.net\managed\x64\configure.bat和处尝试 Oracle 配置脚本{ORACLE HOME}\odp.net\managed\x86\configure.bat,它们也应该这样做

Then check your compile options whether you selected target Framework at least to .NET Framework 4.

然后检查您的编译选项是否至少选择了目标框架.NET Framework 4

Update for Release 12.2

12.2 版更新

Key odp.net.managedseems to be used in old version 12.1. Latest release uses Oracle.ManagedDataAccess:

密钥odp.net.managed似乎在旧版本 12.1 中使用。最新版本使用Oracle.ManagedDataAccess

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\Oracle.ManagedDataAccess]
@="C:\oracle\product\12.2\Client_x64\odp.net\managed\common"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\Oracle.ManagedDataAccess.EntityFramework6]
@="C:\oracle\product\12.2\Client_x64\odp.net\managed\common\EF6"

回答by Christian Shay

The generic answer to this question is "(Re)install 'Oracle Developer Tools for Visual Studio' (ODT)". Simply getting ODP.NET from Nuget or from other sources is not enough to take advantage of Visual Studio integration. You must install ODT also.

这个问题的一般答案是“(重新)安装'Oracle Developer Tools for Visual Studio' (ODT)”。仅仅从 Nuget 或其他来源获取 ODP.NET 不足以利用 Visual Studio 集成。您还必须安装 ODT。

Download "ODTwithODAC": http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

下载“ODTwithODAC”:http: //www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

Update 4/2018: If you are using Visual Studio 2017 Community edition, please upgrade to version 12.2.0.1.1 or later.That is the first version that works with VS 2017 CE: http://www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownloadvs2017-3806459.html

更新 4/2018:如果您使用的是 Visual Studio 2017 社区版,请升级到 12.2.0.1.1 或更高版本。这是第一个适用于 VS 2017 CE 的版本:http: //www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownloadvs2017-3806459.html

As you noticed, sometimes installations get munged. So if you do not see the driver in the dialogs or are getting generic (non-oracle ORA-) errors when you try to use features then you should reinstall ODT.

正如您所注意到的,有时安装会被修改。因此,如果您在尝试使用功能时没有在对话框中看到驱动程序或遇到一般(非 oracle ORA-)错误,那么您应该重新安装 ODT。

回答by Uwe Keim

While Wernfried posted his answerI tried at the same time the following approach:

虽然Wernfried 发布了他的答案,但我同时尝试了以下方法:

  1. Uninstall any previously installed Oracle packages/drivers.
  2. Restart Visual Studio.
  1. 卸载任何以前安装的 Oracle 软件包/驱动程序。
  2. 重新启动 Visual Studio。

After these steps, the drivers were present:

在这些步骤之后,驱动程序出现了:

enter image description here

在此处输入图片说明

I'm still not 100% sure, why a simple uninstallfixes something.

我仍然不是 100% 确定,为什么简单的卸载可以修复某些问题。

回答by JaeKi Lee

I has same error. Since I installed vs2015 Update 3.

我有同样的错误。由于我安装了 vs2015 Update 3。