I'm working on an Excel Addin (VSTO) in .NET that connects to an Oracle 10g database.
I'm running on Vista x64 and have figured out that I need both the x86 and x64 Oracle clients installed on my machine so that both 32 bit processes (like PL/SQL Developer) and 64 bit processes (like an example .NET console app compiled for "Any CPU") can connect to Oracle.
That's all working fine. My problem is that Excel is a 32 bit app hosting a .NET DLL and, according to ProcessMonitor the excel process is loading the "OraClient10g_home1" Oracle client at "C:\oracle\product\10.2.0\client_1\BIN\oci.dll" (which happens to be the 64 bit client) and that gives me a BadImageFormatException when my .NET code tries to use it.
What I want is to tell .NET to load the 32 bit "OraClient10g_home2" Oracle client (i.e. "C:\oracle\product\10.2.0\client_2\BIN\oci.dll"). How can I tell .NET to use client_2 instead of client_1.