'Error: The provider is not compatible with the version of oracle
I have developed a .Net C# based website, which is dependent mostly on Oracle database. To access the DB I have been using Oracle ODAC 11G. (Oracle.DataAccess.dll version: 1.111.6.10).
The website works just fine when I run it locally for testing (Ctrl + F5 on VS 2013). However, after publishing it locally (my PC runs IIS) I encountered a wired error: "The provider is not compatible with the version of oracle".
I have already made sure the app set to run in 32 bit mode in the iis console. But I still can't figure out why the website works when I run it from visual studio, and doesn't work when I publish it.
Solution 1:[1]
Check carefully(!) which version of Oracle Client is installed on target machine.
- Does if have the same architecture (i.e. 32 bit or 64 bit) as your
Oracle.DataAccess.dll
? - Is the version matching. You have to compare even minor version. Just "11.1" is not sufficient.
I recommend Sigcheck tool, i.e.
cd %ORACLE_HOME%
sigcheck -s oraociei*.dll
sigcheck -s OraOps*w.dll
Check also which file Oracle.DataAccess.dll
is loaded. It might be loaded from GAC (the GAC takes precedence by default) instead of the file you provided. Just can find out which DLL has been loaded like this:
var con = New OracleConnection();
Console.WriteLine(con.GetType().Assembly.FullName);
Console.WriteLine(con.GetType().Assembly.Location);
See also The provider is not compatible with the version of Oracle client
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Wernfried Domscheit |