简体   繁体   English

Oracle实体数据模型(ODP.NET)

[英]Oracle Entity Data Model(ODP.NET)

We are trying to create an Entity Data model (edmx) file using Database first approach for Oracle Db.( We already have a running version of edmx for SQL Server). 我们正在尝试使用针对Oracle Db的数据库优先方法创建实体数据模型(edmx)文件。(我们已经有用于SQL Server的edmx的运行版本)。

Installed ODP.NET package which includes Oracle.ManagedDataAccess.dll and Oracle.ManagedDataAccess.EntityFramework.dll in Visual studio 2017 for Framework 4.5 via Nuget Packages Manually modified the connection string for Oracle as 通过Nuget包在Visual Studio 2017 for Framework 4.5中安装了包含Oracle.ManagedDataAccess.dll和Oracle.ManagedDataAccess.EntityFramework.dll的ODP.NET程序包手动将Oracle的连接字符串修改为

  <connectionStrings>
    <add name="FacetsDataModel"
         connectionString="metadata=res://*/EntityDataModel.csdl|res://*/EntityDataModel.ssdl|res://*/EntityDataModel.msl;provider=System.Data.OracleClient;provider connection string=”Data Source=***;User Id=**;Password=***;”;" providerName="Oracle.ManagedDataAccess.Client" />
  </connectionStrings> 

The above approach didn't work because we found out that we are missing ODP.Net Managed Provider in the system. 上面的方法无效,因为我们发现系统中缺少ODP.Net托管提供程序。 So we tried installing ODT Tools for Visual Studio 2013(didn't work) uninstalled the same and installed 2017(still the same issue) 因此,我们尝试安装适用于Visual Studio 2013的ODT工具(无法正常工作),但卸载了该工具并安装了2017(仍然存在相同的问题)

We found out that we missed ODAC (Oracle Data Access Components), so we installed the same but still, we didn't get the ODP.Net Managed Data Provider. 我们发现我们错过了ODAC(Oracle数据访问组件),因此我们安装了相同的组件,但是仍然没有获得ODP.Net托管数据提供程序。

We checked the machine.config file from the below path: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Config 我们从以下路径检查了machine.config文件:C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ Config

When we tried searching for a solution, we got the below link ODP.NET Managed - Unable to find requested.Net Framework Data Provider 当我们尝试搜索解决方案时,我们获得了以下链接ODP.NET托管-无法找到请求的.Net Framework数据提供程序

Point 11 -- They have mentioned modifying the machine.config file by including ODP.NET, Managed Driver Under section. 第11点-他们提到了通过包含ODP.NET,托管驱动程序下一节来修改machine.config文件。 After modifying the machine.config file, our visual studio got crashed. 修改了machine.config文件后,我们的Visual Studio崩溃了。

As mentioned in the link, we checked with Registry key file and check if RegKey exists or not. 如链接中所述,我们检查了注册表项文件并检查RegKey是否存在。

HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx\\odp.net.managed HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Wow6432Node \\ Microsoft.NETFramework \\ v4.0.30319 \\ AssemblyFoldersEx \\ odp.net.managed

A managed ODP.NET driver does not show up in Data Source dialogue 托管的ODP.NET驱动程序未显示在“数据源”对话框中

But in our system, there is no such folder exists named AssemblyFoldersEx in the specified path. 但是在我们的系统中,指定的路径中不存在名为AssemblyFoldersEx的文件夹。

You missed several information, for example what is in your config file machine.config . 您错过了一些信息,例如配置文件machine.config Also you did not provide us any error message. 您也没有向我们提供任何错误消息。 Statements as "The above approach didn't work" are not very helpful. 声明“上述方法无效”不是很有帮助。

Anyway I will try to give you some hints: 无论如何,我会尝试给您一些提示:

  • ODAC (Oracle Data Access Components) is a collection of various providers (ODP.NET managed and unmanaged, ODBC, OLE DB). ODAC(Oracle数据访问组件)是各种提供程序(ODP.NET托管和非托管,ODBC,OLE DB)的集合。 Perhaps you selected the wrong component while installation. 也许在安装时选择了错误的组件。

HKLM\\SOFTWARE\\Wow6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx\\odp.net.managed is not used anymore. 不再使用HKLM\\SOFTWARE\\Wow6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx\\odp.net.managed Usually the installation script should have deleted it. 通常,安装脚本应该已将其删除。 You Registry should look like this: 您的注册表应如下所示:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ODP.Net]
@="c:\\oracle\\product\\12.2\\odp.net\\bin\\2.x"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\ODP.Net]
@="c:\\oracle\\product\\12.2\\odp.net\\bin\\4"

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

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

Of course you have to set folders according to your system. 当然,您必须根据系统设置文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM