实体框架提供商类型'Oracle.ManagedDataAccess.EntityFramework“无法加载 [英] The Entity Framework provider type 'Oracle.ManagedDataAccess.EntityFramework' could not be loaded
问题描述
我试图用连接到Oracle的Oracle数据Provider.NET(ODP.NET)使用MVC应用程序中的实体框架V6。
I am trying to connect to Oracle using the Oracle Data Provider.NET (ODP.NET) using Entity Framework v6 in an MVC application.
我已经安装了ODP.NET从这里:
https://www.nuget.org/packages/odp.net .entityframework / 6.121.1-β
I have installed ODP.NET from here: https://www.nuget.org/packages/odp.net.entityframework/6.121.1-beta
我已经配置我的web.config文件如下:
I have configured my web.config file as follows:
<connectionStrings>
<add name="MyDB" connectionString="User ID=MyUser;Password=MyPassword;Data Source=MyDatabase; Persist Security Info=False" providerName="Oracle.ManagedDataAccess" />
</connectionStrings>
<entityFramework>
<providers>
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>
</entityFramework>
然而,当我尝试打电话给我的EF情况下,我得到以下错误:
However, when I try to call my EF Context, I get the following error:
实体框架提供商类型'Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices,Oracle.ManagedDataAccess.EntityFramework,版本= 6.121.1.0,文化=中性公钥= 89b483f429c47342'在与ADO.NET提供应用程序配置文件中注册不变的名称'Oracle.ManagedDataAccess.EntityFramework无法加载。确保程序集限定名称的使用和该组件提供给运行的应用程序
The Entity Framework provider type 'Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' registered in the application config file for the ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.EntityFramework' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application
我花了很多时间寻找这方面的帮助。将是任何帮助非常感谢!
I have spent a lot of time searching for help with this. Would be very grateful for any help!
谢谢!
马丁
推荐答案
添加本节进行到web.config中,与上述步骤一起,似乎已经解决了这个问题:
Adding this section to the web.config, along with the steps above, seems to have fixed this:
<system.data>
<DbProviderFactories>
<add name="ODP.NET, Managed Driver"
invariant="Oracle.ManagedDataAccess.Client"
description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
这篇关于实体框架提供商类型'Oracle.ManagedDataAccess.EntityFramework“无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!