I\'m trying to use the Oracle ODP.NET 11g (11.1.0.6.20) Instant Client on my ASP.net project as a Data Provider but when I run the aspx pag
This can be caused by running a 64bit .NET runtime against a 32bit Oracle client. This can happen if your server you are running the app on it 64 bit. It will run the .NET app with the 64bit runtime. You can set the CPU flag on your project in VS to run in the 32bit runtime.
I had the exact same problem. I deleted (and forgot that I had deleted) oraociei11.dll after compiling the application. And it was giving this error while trying to execute. So when it cant find the dll that oraociei11.dll, it shows this error. There may be other cases when it gives this error, but this seems to be one of them.
You should "ignore" all the x86/x64 talk here for starters and instead try the ODP.NET Managed Driver (if you are using .Net v4+):
https://www.nuget.org/packages/Oracle.ManagedDataAccess/
https://www.nuget.org/packages/Oracle.ManagedDataAccess.EntityFramework/
Oracle ODP.net Managed vs Unmanaged Driver
Avoid all the "unmanaged" what DLL what architecture issues! :D (about time Oracle).
The NuGet package (also works for 11g):
The old / manual method:
For info on how to convert to using the managed libraries:
I faced a similar issue and the root cause was that GAC had 2 oracle.dataaccess versions i.e. v4.0_4.112.2.0 and v4.0_4.112.4.0 . My application was referring to v4.0_4.112.2.0 , so when I removed v4.0_4.112.4.0 from GAC, it worked fine.
GAC path : C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess
Before :
After :
To remove a version, one can simply delete the corresponding folder from GAC.
http://randomdevtips.blogspot.com/2012/06/provider-is-not-compatible-with-version.html
For Oracle 11g (11.1.0.7.20) I had to add the following dlls along with my Exe to work.