I have created a WCF project in VS 2012 which connects to an Oracle 10g db using the Oracle 11.2.0 (32bit) ODP.NET drivers. The Oracle client is fully installed on my machine (its a DEV server with VS tools installed on it). I am able to connect to Oracle via ODBC and also via the code I have written to use ODP.NET - while it runs in VS 2012.
All is fine, until I try to deploy to the web server ...
On the same machine, I have deployed the project to a folder and hosted that folder in IIS as a web-application which allows 32bit applications to run.
When I try to execute the project under IIS I get the following error message:
"The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception." (there is no inner exception).
I have spent a LOT of time reading and trying various tips. Here are the facts:
1. The Oracle Client is installed and running fine on the machine
3. My PATH starts with: C:\oracle\bin;C:\oracle
4. I am referencing Oracle.DataAccess.dll from C:\Oracle\odp.net\bin\4
5. I have copied the following files into the destination BIN folder:
OraOps11w.dll (v18.104.22.168) - I cannot see any other versions
6. My registry entry: HKLM\SOFTWARE\ORACLE\ODP.NET\22.214.171.124 has a DllPath=C:\Oracle\odp.net\bin\4 - I have no other ORACLE registry entries at that level.
7. I have tried OleDb and the deprecated MS Oracle drivers and they caused even more issues and wouldn't work in dev mode (vs 2012) so I do NOT want to attempt that again.
So my overarching question is: why on the SAME machine can I run this successfully in VS 2012 but NOT when I deploy to IIS??
I need some fresh ideas and a detailed step-by-step on how to make this work as I am pulling my hair out. Why does Oracle have to make it so difficult to interact with .NET???!
:-) any help would be most appreciated!