带有 oracle 的 EF - “在配置中找不到指定的商店提供程序,或者该提供程序无效." [英] EF with oracle - "The specified store provider cannot be found in the configuration, or is not valid."

查看:107
本文介绍了带有 oracle 的 EF - “在配置中找不到指定的商店提供程序,或者该提供程序无效."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .net 4.5 程序中使用带有 oracle 客户端 (odp.net) 的实体框架.

I am using entity framework with oracle client (odp.net) in a .net 4.5 program.

在生产机器中,我收到以下错误:

In production machine I get the following error:

System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)

开发机器上没有错误.生产机器上还有其他 .net 程序可以使用 odp.net 成功地针对 oracle 运行.这些旧程序使用 .net 3.5.

No error on development machine. There are other .net programs on the production machine that run successfully against oracle using odp.net. These old programs are with .net 3.5.

我理解是因为.net 4.5是在Orcale客户端安装oracle之后安装的数据访问组件未在 .net 4.5 machine.config 中注册.我尝试将 system.data 部分从 3.5 machine.config 复制到应用程序的配置文件中 - 但它没有帮助.重新安装 Oracle 客户端不是我们想要做的事情 - 因为其他应用程序可以正常工作.

I understood that because .net 4.5 was installed after the Orcale client installation the oracle data access components are not registered in .net 4.5 machine.config . I tried copying the system.data section from the 3.5 machine.config into the application's config file - but it did not help. Reinstalling Oracle client is not something we would like to do - because of the other appllcations that work fine.

我还注意到开发机器和生产机器之间的 ODP.Net 版本存在细微差别.我的项目没有对 oracle.dataaccess.dll 的任何引用.

I also noticed that that there is a minor difference in the ODP.Net version between the development machine and production. My project does not have any reference to oracle.dataaccess.dll.

推荐答案

如果您使用的是 64 位系统,请确保您的 ASP.NET 应用程序使用的应用程序池允许 32 位应用程序.使用管理工具下的 Internet 信息服务 (IIS) 管理器工具来配置您的 Web 应用程序和相应的池.(在 IIS 管理器中找到池,右键单击它并选择高级设置.)否则您的应用程序可能会在 64 位模式下运行并寻找 64 位版本的 Oracle 数据提供程序,该版本可能不存在于您的机器.

If you are on a 64-bit system, make sure the application pool that your ASP.NET app is using allows 32-bit applications. Use Internet Information Services (IIS) Manager tool under Administration Tools to configure your web app and the corresponding pool. (Find the pool in the IIS Manager, right-click on it and select Advanced Settings.) Otherwise your application may run in the 64-bit mode and seek a 64-bit version of the Oracle data provider which may not be present on your machine.

这篇关于带有 oracle 的 EF - “在配置中找不到指定的商店提供程序,或者该提供程序无效."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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