logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Trouble using AdoNetAdapter with .net 2.0 project
Date Sat, 10 Jun 2006 13:41:06 GMT
I think this it the correct OleDbConnection signature for .NET 2.0:

System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089

Maybe the error is occuring becuase you're telling .NET 2.0 to use the
1.1 object.

What happens if you omit the PublicKeyToken and let the Framework
decide which object to use:

 <coonnectionType 
  value="System.Data.OleDb.OleDbConnection, System.Data"/>

--- Nikos Viorres <nviorres@aegean.gr> wrote:

> Hi all,
>  
> When trying to log into an access db using the AdoNetAdapter with an
> OleDb
> connection i get the following error in a  VS 2005 (.NET 2.0)
> project.
> Please take note that the exact same project with the same
> configuration
> works fine under .NET 1.1 (VS 2003).
> 
> A first chance exception of type
> 'System.Runtime.InteropServices.InvalidComObjectException' occurred
> in
> System.Data.dll
> log4net:ERROR [AdoNetAppender] Exception while writing to database
> System.Runtime.InteropServices.InvalidComObjectException: COM object
> that
> has been separated from its underlying RCW cannot be used.
>    at
> System.Data.Common.UnsafeNativeMethods.ICommandText.Execute(IntPtr
> pUnkOuter, Guid& riid, tagDBPARAMS pDBParams, IntPtr& pcRowsAffected,
> Object& ppRowset)
>    at
>
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
> dbParams, Object& executeResult)
>    at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> executeResult)
>    at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> behavior, Object& executeResult)
>    at
> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> behavior, String method)
>    at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
>    at log4net.Appender.AdoNetAppender.SendBuffer(IDbTransaction
> dbTran,
> LoggingEvent[] events)
>    at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[]
> events)
> A first chance exception of type
> 'System.Runtime.InteropServices.InvalidComObjectException' occurred
> in
> System.Data.dll
> log4net:WARN AdoNetAppender: Exception while disposing cached command
> object
> System.Runtime.InteropServices.InvalidComObjectException: COM object
> that
> has been separated from its underlying RCW cannot be used.
>    at
>
System.Data.Common.UnsafeNativeMethods.IAccessor.ReleaseAccessor(IntPtr
> hAccessor, Int32& pcRefCount)
>    at System.Data.OleDb.RowBinding.Dispose()
>    at System.Data.OleDb.Bindings.Dispose()
>    at System.Data.OleDb.OleDbCommand.CloseInternal()
>    at System.Data.OleDb.OleDbCommand.ResetConnection()
>    at System.Data.OleDb.OleDbCommand.Dispose(Boolean disposing)
>    at System.ComponentModel.Component.Dispose()
>    at log4net.Appender.AdoNetAppender.OnClose()
> 
> 
> The configuration file of log4net for AdoNetAdapter looks like this:
> <appender name="MSAccess" type="log4net.Appender.AdoNetAppender">
> 		<connectionType value="System.Data.OleDb.OleDbConnection,
> System.Data, Version=1.0.330.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>		
> 		<connectionString
> value="Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=D:\nviorres\Develepoment\e-passport\CSCA-05\csca.mdb;User
> Id=Admin;Password=;" />
> 
> Thanks in advance
> Nikos
> 
> 
> 


Mime
View raw message