Maybe this is a boring topic for you, I've checked several posts, tried many things, no success. On my DEV environment everything works, on the TEST env I cannot connect to oracle, I get: "The provider is not compatible with the version of oracle" error. Here are my environments: DEV env:
win 7 Prof SP1, 32 bit
.Net FW 4 client profile, .Net FW 4 Extended, .Net FW Multi-Targeting Pack
Visual Studio 2010 TEST env:
Win 2003 Server R2 SP1, 32 bit
.Net FW 2.0, .Net FW 3.0, .Net FW 4 client profile, .Net FW 4 Extended
On the TEST env I uninstall the oracle driver I get: "Unable to find requested .NEt Framework Data Provider. It may not be installed" which is good, since no driver is installed.
If I install ODP.NET2 I get the same: "Unable to find requested .NEt Framework Data Provider. It may not be installed"
If I install ODP.NET4 I get: "The provider is not compatible with the version of oracle"
Each time I check the registry and it looks good, only one driver is installed.
I've tried to copy the oracle driver dlls next to my dlls, same result - in case of ODP.NET2 I get "the provider is not comp..." error.
What else can I do, any idea?
The error you're getting tends to come up when you have an Oracle.DataAccess.dll from one version of Oracle, and the unmanaged Oracle client on the machine is a different version. A typical culprit is Copy Local = True on your Oracle.DataAccess reference in your project. Try changing that to false, then doing a Clean & Rebuild on the project. Then delete everything off test and redeploy.
That said, how are you installing ODP.net 2 vs 4? Both of them come in the same install package. The trick here is that Test should have the same version of the Oracle client software that Dev has, or as close to it as possible. That installation will set up ODP.net for you.
I don't have the Oracle.DataAccess.dll in bin/Debug. Once I copied it manually to try out if it works, but no success.
I install ODP.net 2 this way: install.bat odp.net2 c:\oracle oracle_home
then uninstall and install ODP.net 4 in the same way: install.bat odp.net4 c:\oracle oracle_home
I've installed the same oracle client (using exactly the same zip) to my TEST and DEV envs
Still sounds like your main Oracle client isn't installed correctly and Oracle.DataAccess.dll is acting up because of that. Try it with basic to make sure the Instant Client is installed, or grab the version that uses the universal installer and run that instead. I know that version works, I'm using it right now. :)
The Oracle client for .net comes in two pieces. There's the .net part (Oracle.DataAccess.dll and some related files), and the "native" part (the Oracle client). Both of them need to be installed for things to work. The error you're getting happens when the .net part and the native part aren't the same version.
For my money, the simplest way to get up and running is to use the universal installer version, instead of the xcopy one. So remove the Oracle clients you have right now. Download the first package here: http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Unzip it, run setup, and it will install everything you need.