Yes, I have checked the other similar questions, but none of them seem to match the problems I am having.
I have a 64-bit Windows client with 64-bit Oracle installed, but my app uses a library that requires a 32-bit Oracle client. I created a directory and put the 32-bit Instant Client Basic files into it, and added the suggested entries to web.config, but when I try running the app locally, I get two sorts of exceptions thrown.
Here is the web.config file:
<configuration>
<configSections>
<section name="oracle.dataaccess.client"
type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<system.data>
<DbProviderFactories>
<!-- Remove in case this is already defined in machine.config -->
<remove invariant="Oracle.DataAccess.Client" />
<add name="Oracle Data Provider for .NET"
invariant="Oracle.DataAccess.Client"
description="Oracle Data Provider for .NET"
type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories>
</system.data>
<system.web>
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1" />
</system.web>
<oracle.dataaccess.client>
<settings>
<add name="DllPath" value="C:\ora\InstantClient32_12-2-0-1-0"/>
<add name="FetchSize" value="1048576"/>
<add name="PromotableTransaction" value="promotable"/>
<add name="StatementCacheSize" value="10"/>
<add name="TraceFileName" value="C:\ora\InstantClient32_12-2-0-1-0\odpnet2.trc"/>
<add name="TraceLevel" value="0"/>
<add name="TraceOption" value="1"/>
</settings>
</oracle.dataaccess.client>
</configuration>
However,
OracleConnection conn = new OracleConnection(connectionString);
(where connectionString is a valid connection string) throws,
The provider is not compatible with the version of Oracle client.
If I change 4.0.0.0 to 4.112.3.0 in the ConfigSection entry, it throws,
Could not load file or assembly 'System.Data, Version=4.112.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Note that oracle.dataaccess.client is a 32-bit client - but I think system.data might be 64-bit (is there any way to tell the difference?).
Also note that, because the app depends on an external app that also uses the 32-bit unmanaged oracle.dataaccess client, I can't switch from OracleClient to OracleManagedClient.
I am running this on the 32-bit IIS Express. I have also tried switching the CPU to "x86", with no effect.
What do I need to do to get this running?
EDIT When I change the DllPath setting to a directory that does not exist, it still throws, "The provider is not compatible with the version of Oracle client." I am guessing that DllPath does not do what I think it does, and Oracle.DataAccess is trying to use my installed full version of Oracle (which is 64-bit).
Next question: how do I get my app to use the 32-bit Instant Client files that I have?