Oracle 12.2.0中的EntityFramework 6 Code First

时间:2017-06-06 13:44:39

标签: c# .net entity-framework ef-code-first odp.net

我使用实体框架代码firts 6.0

我使用了Oracle Client 12.1.0,并将该部分添加到我的web.config中,并且它正在运行

input.foo.bar

我将我的驱动器升级到oracle 12.2.0并且我像这样更改了我的web.config(只有Version = 6.122.1.0,Culture = neutral,PublicKeyToken = 89b483f429c47342“/>部分已更改)但是我收到了这个错误,我错过了什么?

  

未处理的错误:System.NotSupportedException:无法执行   确定类型的提供者工厂的提供者名称   'Oracle.DataAccess.Client.OracleClientFactory'。确保   ADO.NET提供程序已在应用程序配置中安装或注册。

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="v11.0" />
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="Oracle.DataAccess.Client" type="Oracle.DataAccess.EntityFramework.EFOracleProviderServices, Oracle.DataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>

1 个答案:

答案 0 :(得分:0)

I added this section and it works


<system.data>
<DbProviderFactories>
  <!-- Remove in case this is already defined in machine.config -->
  <remove invariant="Oracle.DataAccess.Client" />
  <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  <add name="EF Tracing Data Provider" invariant="EFTracingProvider" description="Tracing Provider Wrapper" type="EFTracingProvider.EFTracingProviderFactory, EFTracingProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=def642f226e0e59b" />
</DbProviderFactories>