The type initializer for ‘Oracle.DataAccess.Client.OracleConnection’ threw an exception

odp.netoracleclient

I have developed an application that uses Oracle Data Provider for .NET. I copy the application file (.exe) and ODP library (Oracle.DataAccess.dll) on another computer that Oracle client and ODP.NET are NOT installed on. When I run the application, I got the error msg: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

*****************Exception Text***************
System.TypeInitializationException: The type initlializer for 'Oracle.DataAccess.Client.OracleConnection at Oracle.DataAccess.Client.OracleConnection..cctor()
  --- End of inner exception stack trace ---
  at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
  ...

Do I have to install ODP.NET and Oracle client on the computer that I want to run my application? If yes, is there other way that I don't have to install them but still can run my application?

Thank you

Best Answer

Both Oracle Data Provider for .NET (from Oracle) and .NET Framework Data Provider for Oracle (from Microsoft) require Oracle Client installed on machine.

Related Topic