EF with oracle - “The specified store provider cannot be found in the configuration, or is not valid.”

和自甴很熟 提交于 2019-12-13 05:05:24

问题


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)

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.

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.

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.


回答1:


Can you run the Oracle installer for ODAC on the production machine? That will create the required machine.config entries.

Also in a the currently available beta, we offer a "local" install which modifies the web or app config rather than the machine config.




回答2:


May be you just installed the 32 bit version on the 64 operating system. In run time you also need to install 64 bit version.

be sure you add the tns file and reastart after installation




回答3:


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.



来源:https://stackoverflow.com/questions/26137256/ef-with-oracle-the-specified-store-provider-cannot-be-found-in-the-configurat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!