log4net.Appender.AdoNetAppender 连接类型 Oracle.ManagedDataAccess.Client

log4net.Appender.AdoNetAppender connectionType Oracle.ManagedDataAccess.Client

我正在尝试将我的 .NET 4.5 Windows 服务从非托管服务切换到 Oracle.ManagedDataAccess.dll ODP.NET 4.121.1.0。该应用程序本身运行良好。切换到 ODP.NET 4.121.2.0 没有帮助。

多年来我一直将 log4net 保存到数据库中 table 在 AdoNetAppender 中设置连接类型:

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

我想使用托管连接,但经过数小时 google 搜索后,我找不到有效的连接类型。

App.Config :

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

textWriterTraceListener 的输出包含:

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'.

我认为 App.Config 一定是这样的:

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