In my project I am using oracle and entity framework together.Both of my machines my developer machine win7 and my server win2008r2 I installed oracle beta entity framework
We were installing our application on a windows 2012 server and we were getting the same error, we tried to run the applications in the 32 bit mode , but results are same. we tried to get the list of DbProviderFactories installed in the machine by a console app and figured out that the ODP.net Managed Driver is missing. it finally worked when we ran the batch file we found
In the Application Pool and Advanced Settings...
Have a look at the "Enable 32-Bit Applications" and see if it is enabled. It wasn't set on my Windows 7 64bit and I had the same issues.
I am guessing it might also be fixed by installing the 64bit ODAC but haven't tried that yet.
Installing ManagedDataAcces solved the problem for me.
I had this problem before. I followed these instructions then it solved: with windows 10 x64
1- Install Visual Studio 2015.
2- Install ODAC from http://www.oracle.com/partners/campaign/utilsoft-086879.html.
install ODTforVS2015 from http://www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownload-2745497.html
copy tnsnames file witch configured in step #2 and paste it to Network folder of destination installation of step #3.
change C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Machine.config <system.Data>
tag like this:
<system.data>
<DbProviderFactories>
<add name="ODP.NET, Unmanaged Driver" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET, Unmanaged Driver" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
<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.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
add this line in web.config for web app, or in App.config if it is console App. under <configurations> </configurations>
tag (Under not inside).
<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.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
If you are getting this error in 2018 and you are using IIS Express like I am, you may want to check your .csproj settings and ensure that it is running under x64 bitness. (Right click you web application's csproj, go to "Web" tab, under the "Servers" section, change the bitness to x64).
in short: do not use ODAC .net drivers, instead use oracle client complete installation. modifying ODAC components may be a bit diffucilt. So install latest version of oracle client to all machines everything is well.
In my development machine oracle beta entity framework is configured as default client. -I dont know when/how it changed/ who changed -
In server default provider is still old odp.net .
After changing the default provider at server to oracle beta entity framework provider it changed.
Thanks again.