简体   繁体   中英

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).

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

  <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. So we tried installing ODT Tools for Visual Studio 2013(didn't work) uninstalled the same and installed 2017(still the same issue)

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.

We checked the machine.config file from the below path: 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

Point 11 -- They have mentioned modifying the machine.config file by including ODP.NET, Managed Driver Under section. After modifying the machine.config file, our visual studio got crashed.

As mentioned in the link, we checked with Registry key file and check if RegKey exists or not.

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

But in our system, there is no such folder exists named AssemblyFoldersEx in the specified path.

You missed several information, for example what is in your config file 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). Perhaps you selected the wrong component while installation.

HKLM\\SOFTWARE\\Wow6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx\\odp.net.managed is not used anymore. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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