Oracle即时客户端和配置实体框架的麻烦 [英] Oracle Instant Client and Entity Framework trouble with configuration

查看:181
本文介绍了Oracle即时客户端和配置实体框架的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习,找出是否有可能一个MVC,EF,ODAC 11.2.0.3应用程序部署到已安装ODP.NET的previous版本的服务器。而不是更新断绝ODP.NET(这我做不到),我想我可以使用Oracle即时客户端。

I'm trying to learn and figure out if it is possible to deploy an MVC, EF, ODAC 11.2.0.3 app to a server that has a previous version of ODP.NET installed. Rather than updating the sever ODP.NET (which I can't), I figured I could use the Oracle Instant Client.

这是可行的?

1)我添加这些DLL到我的项目,以支持即时客户端

1) I added these dlls to my project to support Instant Client

-Oracle.DataAccess.dll

-Oracle.DataAccess.dll

-oci.dll

-ociw32.dll

-ociw32.dll

-orannzsbb11.dll

-orannzsbb11.dll

-oraociei11.dll

-oraociei11.dll

-OraOps11w.dll

-OraOps11w.dll

2)接下来,我为dbProviderFactories更新的web.config

2) Next I updated web.config for the dbProviderFactories

   <system.data>
    <DbProviderFactories>
    <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.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
    </system.data>

3)(据我所知)是如何使用Oracle DLL在bin rathre比GAC

3) This (afaik) is how to use the Oracle dll in the bin rathre than the GAC

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" />
    <publisherPolicy apply="no" />
  </dependentAssembly>
</assemblyBinding>
</runtime>

4)最后我的connectionString

4) Finally my connectionString

    <connectionStrings>
    <add name="Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=Oracle.DataAccess.Client;
provider connection string=&quot;DATA SOURCE=XXX;PASSWORD=XXX;PERSIST SECURITY INFO=True;USER ID=XXX&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

这是我收到的错误
无法找到请求的.NET Framework数据提供程序。它可能没有安装。

This is the error I receive Unable to find the requested .Net Framework Data Provider. It may not be installed.

我真的AP preciate任何帮助在这里。我相当新的,有很多东西需要学习。提前致谢。欢呼声

I really appreciate any help here. I'm rather new and have a lot to learn. Thanks in advance. cheers

推荐答案

添加&LT;清除... /&GT; 部分中的&LT; DbProviderFactories&GT; 在web config元素,以消除任何现有的Oracle供应商。 (前&LT;添加&gt;

Add a <remove … /> section in the <DbProviderFactories> element in the web config to remove any existing Oracle provider. (before the <add>)

&LT;清除不变=Oracle.DataAccess.Client/&GT;

这篇关于Oracle即时客户端和配置实体框架的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆