3
votes

I'm attempting to switch my .NET 4.5 Windows service from unmanaged to Oracle.ManagedDataAccess.dll ODP.NET 4.121.1.0. The app itself works fine. Switching to ODP.NET 4.121.2.0 doesn't help.

I've been saving log4net into a database table for years setting the connection type in the AdoNetAppender:

<connectionType value="Oracle.DataAccess.Client.OracleConnection, 
    Oracle.DataAccess, Version=2.112.1.2, Culture=neutral, 
    PublicKeyToken=89B483F429C47342" />

I'd like to use a Managed connection but after many hours and google searches I can't find a connection type that works.

App.Config :

connectionType value="Oracle.ManagedDataAccess.Client, 
         Oracle.ManagedDataAccess, Version=4.121.1.0, 
         Culture=neutral, PublicKeyToken=89b483f429c47342"

Output to textWriterTraceListener contains:

log4net:ERROR [AdoNetAppender] ErrorCode: GenericFailure. Failed to load connection type [Oracle.ManagedDataAccess.Client, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342] System.TypeLoadException: Could not load type 'Oracle.ManagedDataAccess.Client' from assembly 'Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342'.

1

1 Answers

12
votes

I think the App.Config must be this:

connectionType value="Oracle.ManagedDataAccess.Client.OracleConnection, 
         Oracle.ManagedDataAccess, Version=4.121.1.0, 
         Culture=neutral, PublicKeyToken=89b483f429c47342"