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
Also look for IIS Application pool Enable 32-bit true or false flag, when you see this message, some oracle forum directed me for this!
Just two steps to solve this issue.
best of luck.
This issue could by happen while using unmanaged oracle reference if you have more than one oracle client , or sometimes if you reference different version
There is two way to solve it :
First and fast solution is to remove unmanaged reference and use the managed one from NuGet see this before to go with this option Differences between the ODP.NET Managed Driver and Unmanaged Driver
Second solution is to fix project unmanaged target version like the below :
Then check oracle GAC version
got to gac from run (Win+R) "%windir%\Microsoft.NET\assembly"
Check the platform that matches with you project platform
to check you target platform (right click on your project > properties)
From gac folder search to Oracle.DataAccess
Right Click on Oracle.DataAccess > properties > details and check version
if you notice the versions are different this is an the issue and to fix it we need to redirect assembly version (in startup project go to config file and add the below section )
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="4.121.2.0" />
</dependentAssembly>
</assemblyBinding>
like this
oldVersion : should be cover your project version
newVersion : GAC version
publicKeyToken : From GAC
i have the same problem but in my case i can't just copy the dlls into the bin folder, then i only 'rebind' the assembly version.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89B483F429C47342" culture="neutral"/>
<bindingRedirect oldVersion="2.112.2.0" newVersion="2.112.1.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Here's what I did to solve this problem that persisted for 3 long hours:
Under Oracle home located at C:\oracle\product\11.2.0
I had a folder called client_1
where I had previously installed ODP.NET
bits for Windows 64 bits.
Later while trying to debug my ASP.NET Web API app with Visual Studio 2012, I kept getting this error message: The provider is not compatible with the version of Oracle client.
Searching Google I found that this was happening because I was using ODP.NET
64 bits. Then I grabbed ODP.NET
for Windows 32 bits and installed it but I kept getting the same error message.
SOLUTION: deleted the folder client_1
and resinstalled ODP.NET
32 bits. Somewhat the installer was mixing bits from the 64 bit version with the 32 bit version. Go figure...
Now I'm happy again and I can open a new OracleConnection
. FINALLY! :)
Recently I had to work on an older project where the solution and all contained projects were targeted to x32 platform. I kept on trying to copy Oracle.DataAccess.dll and all other suggested Oracle files on all the places, but hit the wall every time. Finally the bulb in the head lit up (after 8 hours :)), and asked to check for the installed ODAC assemblies and their platform. I had all the 64-bit (x64) ODAC clients installed already but not the 32 bit ones (x32). Installed the 32-bit ODAC and the problem disappeared.
How to check the version of installed ODAC: Look in folder C:\Windows\assembly. The "Processor Architecture" property will inform the platform of installed ODAC.
Eight hours is a long time for the bulb to light up. No wonder I always have to slog at work :).