Error using ADONetAppender

2004-08-04 Thread Ping Xie

Hi,

I'm try to log messages to Oracle database.
I got the following debug errors when run my application.

---
log4net:ERROR [ADONetAppender] Failed
to load connection type [System.Data.Oracl
eClient.OracleConnection,System.Data.OracleClient,
Version=1.2.0.30714, Culture=
neutral,PublicKeyToken=b32731d11ce58905]
System.IO.FileLoadException: The located
assembly's manifest definition with nam
e 'System.Data.OracleClient' does not
match the assembly reference.
File name: "System.Data.OracleClient"
   at System.Type.GetType(String
typeName, Boolean throwOnError)
   at log4net.Appender.ADONetAppender.ResolveConnectionType()

=== Pre-bind state information ===
LOG: DisplayName = System.Data.OracleClient,
Version=1.2.0.30714, Culture=neutra
l, PublicKeyToken=b32731d11ce58905
 (Fully-specified)
LOG: Appbase = C:\hv\HF Security\Log4net\log4net-1.2.0-beta8\examples\net\1.0\Tu
torials\ConsoleApp\cs\build\debug\
LOG: Initial PrivatePath = NULL
Calling assembly : log4net, Version=1.2.0.30714,
Culture=neutral, PublicKeyToken
=b32731d11ce58905.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file
from C:\WINDOWS\Microsoft.NET\Framework\v1
.1.4322\config\machine.config.
LOG: Post-policy reference: System.Data.OracleClient,
Version=1.2.0.30714, Cultu
re=neutral, PublicKeyToken=b32731d11ce58905
LOG: Attempting download of new URL
file:///C:/hv/HF Security/Log4net/log4net-1.
2.0-beta8/examples/net/1.0/Tutorials/ConsoleApp/cs/build/debug/System.Data.Oracl
eClient.DLL.
WRN: Comparing the assembly name resulted
in the mismatch: Minor Version

-

The following is the ADONetAppender
portion of my config file. Does anyone know what is wrong?


       

         
          
         
               
  
         
               
  
         
          
         
          
         
              
         
              
         
              
         
          param>
         
          
         
              
         
              
         
              
         
              
         
               
      
         
              param>
         
          param>
         
          
         
              
         
              
         
              
         
              
         
               
      
         
              param>
         
          param>
         
          
         
              
         
              
         
              
         
              
         
               
      
         
              param>
         
          param>
         
          
         
              
         
              
         
              
         
              
         
               
      
         
              param>
         
          param>
        appender>

RE: Error using ADONetAppender

2004-08-11 Thread Nicko Cadell

> I'm try to log messages to Oracle database. I got the 
> following debug errors when run my application. 
> 
> --
> -
> log4net:ERROR [ADONetAppender] Failed to load connection type 
> [System.Data.Oracl 
> eClient.OracleConnection,System.Data.OracleClient, 
> Version=1.2.0.30714, Culture= neutral,PublicKeyToken=b32731d11ce58905]
> System.IO.FileLoadException: The located assembly's manifest 
> definition with nam e 'System.Data.OracleClient' does not 
> match the assembly reference. 

This means that the assembly specified in the config file for the
OracleClient does not match the manifest of the
System.Data.OracleClient.dll assembly found on disk.

In the config file you have specified the ADO.NET provider to use as:

System.Data.OracleClient.OracleConnection,System.Data.OracleClient,
Version=1.2.0.30714, Culture=neutral,PublicKeyToken=b32731d11ce58905

The version number and public key are not correct for the
System.Data.OracleClient assembly. Try the following: 

Version=1.0.3300.0
PublicKeyToken=b77a5c561934e089

If you still get the same error then you will need to find your
System.Data.OracleClient assembly and find the correct version number
and public key token from the file. You can get the version from the
file properties dialog. To get the public key token you need to use
sn.exe with the -t option. Sn.exe is shipped with the .net SDK in
VisualStudio.


Nicko

> File name: "System.Data.OracleClient" 
>at System.Type.GetType(String typeName, Boolean throwOnError) 
>at log4net.Appender.ADONetAppender.ResolveConnectionType() 
> 
> === Pre-bind state information ===
> LOG: DisplayName = System.Data.OracleClient, 
> Version=1.2.0.30714, Culture=neutra l, PublicKeyToken=b32731d11ce58905
>  (Fully-specified)
> LOG: Appbase = C:\hv\HF 
> Security\Log4net\log4net-1.2.0-beta8\examples\net\1.0\Tu
> torials\ConsoleApp\cs\build\debug\
> LOG: Initial PrivatePath = NULL
> Calling assembly : log4net, Version=1.2.0.30714, 
> Culture=neutral, PublicKeyToken =b32731d11ce58905. 
> === 
> 
> LOG: Publisher policy file is not found. 
> LOG: Host configuration file not found. 
> LOG: Using machine configuration file from 
> C:\WINDOWS\Microsoft.NET\Framework\v1
> .1.4322\config\machine.config. 
> LOG: Post-policy reference: System.Data.OracleClient, 
> Version=1.2.0.30714, Cultu re=neutral, PublicKeyToken=b32731d11ce58905
> LOG: Attempting download of new URL file:///C:/hv/HF 
> Security/Log4net/log4net-1. 
> 2.0-beta8/examples/net/1.0/Tutorials/ConsoleApp/cs/build/debug
> /System.Data.Oracl
> eClient.DLL. 
> WRN: Comparing the assembly name resulted in the mismatch: 
> Minor Version 
> 
> --
> --- 
> 
> The following is the ADONetAppender portion of my config 
> file. Does anyone know what is wrong? 
> 
> --
> -- 
>  type="log4net.Appender.ADONetAppender" > 
>  value="System.Data.OracleClient.OracleConnection,System.Data.O
> racleClient, Version=1.2.0.30714, 
> Culture=neutral,PublicKeyToken=b32731d11ce58905" /> 
>  value="data source=[netbltsdb1];User ID=[docex];Password=[docex]" /> 
>  value="INSERT INTO Log (Datetime, 
> Thread,Log_Level,Logger,Message) VALUES 
> (:log_date,:thread,:log_level,:logger,:message)" /> 
>  
>  
>  value=":log_date" /> 
>  
>  type="log4net.Layout.RawTimeStampLayout" /> 
>  
>  
>  value=":thread" /> 
>  
>  
>  type="log4net.Layout.PatternLayout"> 
>  name="ConversionPattern" value="%t" /> 
>  
>  
>  
>  value=":log_level" /> 
>  
>  
>  type="log4net.Layout.PatternLayout"> 
>  name="ConversionPattern" value="%p" /> 
>  
>  
>  
>  value=":logger" /> 
>  
>  
>  type="log4net.Layout.PatternLayout"> 
>  name="ConversionPattern" value="%c" /> 
>  
>  
>  
>  value=":message" /> 
>  
>  
>  type="log4net.Layout.PatternLayout"> 
>

RE: Error using ADONetAppender

2004-08-11 Thread Ping Xie

Nicko,

Thank you very much for your response.
I found out the version number and public key token of
System.Data.OracleClient assembly
and modified my configuration file. But I still got the same error. 

System.Data.OracleClient.dll
is in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 directory of my machine.
I had put this directory in the Path. I also tried to copy the dll to the
application exe directory. It has the same result. I searched my machine.
There is only one System.Data.OracleClient.dll.
 What else could be wrong?

The following are  my new config
and result.

Config -
<appender
name="ADONetAppender_Oracle"
type="log4net.Appender.ADONetAppender"
>
         
          <param
name="ConnectionType"
value="System.Data.OracleClient.OracleConnection,
System.Data.OracleClient, Version=1.1.4322.573, Culture=neutral, PublicKeyToken=350c7afdc4c296b5"
/>
         
               
  <param
name="ConnectionString"
value="data
source=[proddevdatabase];User ID=[chris9];Password=[chris9]"
/>
         
               
  <param
name="CommandText"
value="INSERT
INTO Log (Datetime, Thread,Log_Level,Logger,Message) VALUES (:log_date,:thread,:log_level,:logger,
:message)" />
         
          <param
name="BufferSize"
value="128"
/>
         
          <param
name="Parameter">
..
-


Result 
log4net:ERROR [ADONetAppender] Failed
to load connection type [System.Data.Oracl
eClient.OracleConnection, System.Data.OracleClient,
Version=1.1.4322.573, Cultur
e=neutral, PublicKeyToken=350c7afdc4c296b5]
System.IO.FileNotFoundException: File
or assembly name System.Data.OracleClient,
 or one of its dependencies, was
not found.
File name: "System.Data.OracleClient"
   at System.Type.GetType(String
typeName, Boolean throwOnError)
   at log4net.Appender.ADONetAppender.ResolveConnectionType()

=== Pre-bind state information ===
LOG: DisplayName = System.Data.OracleClient,
Version=1.1.4322.573, Culture=neutr
al, PublicKeyToken=350c7afdc4c296b5
 (Fully-specified)
LOG: Appbase = C:\hv\HF Security\Log4net\log4net-1.2.0-beta8\examples\net\1.0\Tu
torials\ConsoleApp\cs\build\debug\
LOG: Initial PrivatePath = NULL
Calling assembly : log4net, Version=1.2.0.30714,
Culture=neutral, PublicKeyToken
=b32731d11ce58905.
===


I appreciate it.

Ping Xie

CACI
4831 Walden Lane
Lanham, MD 20706
[EMAIL PROTECTED]
(301) 306-8200 - Main
(301) 306-2829 - Direct







"Nicko Cadell" <[EMAIL PROTECTED]>
08/11/2004 09:36 AM
Please respond to "Log4NET User"
        
        To:
       "Log4NET User" 
        cc:
       
        Subject:
       RE:  Error using ADONetAppender



> I'm try to log messages to Oracle database. I got the 
> following debug errors when run my application. 
> 
> --
> -
> log4net:ERROR [ADONetAppender] Failed to load connection type 
> [System.Data.Oracl 
> eClient.OracleConnection,System.Data.OracleClient, 
> Version=1.2.0.30714, Culture= neutral,PublicKeyToken=b32731d11ce58905]
> System.IO.FileLoadException: The located assembly's manifest 
> definition with nam e 'System.Data.OracleClient' does not 
> match the assembly reference. 

This means that the assembly specified in the config file for the
OracleClient does not match the manifest of the
System.Data.OracleClient.dll assembly found on disk.

In the config file you have specified the ADO.NET provider to use as:

System.Data.OracleClient.OracleConnection,System.Data.OracleClient,
Version=1.2.0.30714, Culture=neutral,PublicKeyToken=b32731d11ce58905

The version number and public key are not correct for the
System.Data.OracleClient assembly. Try the following: 

Version=1.0.3300.0
PublicKeyToken=b77a5c561934e089

If you still get the same error then you will need to find your
System.Data.OracleClient assembly and find the correct version number
and public key token from the file. You can get the version from the
file properties dialog. To get the public key token you need to use
sn.exe with the -t option. Sn.exe is shipped with the .net SDK in
VisualStudio.


Nicko

> File name: "System.Data.OracleClient" 
>    at System.Type.GetType(String typeName, Boolean throwOnError)

>    at log4net.Appender.ADONetAppender.ResolveConnectionType()

> 
> === Pre-bind state information ===
> LOG: DisplayName = System.Data.OracleClient, 
>

RE: Error using ADONetAppender

2004-08-11 Thread Nicko Cadell
Looking at the assembly with the file system properties and the sn.exe
tool seems to be giving a different set of results to the .NET
Reflector.

The .NET Reflector (http://www.aisto.com/roeder/dotnet) thinks that the
strong name for the assembly is:

System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089

I am not sure why this is different to the Public key token displayed by
sn.exe. Try the above details.

Also the System.Data.OracleClient references the following DLLs:

mtxoci8.dll
oci.dll
oramts.dll

I am assuming that these either come with the OracleClient or are part
of the Oracle client tools for windows. These DLLs need to be located
either in the windows system32 directory or the application bin
directory for the Windows DLL loader to find them.

Nicko


> -Original Message-
> From: Ping Xie [mailto:[EMAIL PROTECTED] 
> Sent: 11 August 2004 16:23
> To: Log4NET User
> Subject: RE: Error using ADONetAppender
> 
> 
> Nicko, 
> 
> Thank you very much for your response. I found out the 
> version number and public key token of 
> System.Data.OracleClient assembly and modified my 
> configuration file. But I still got the same error. 
> 
> System.Data.OracleClient.dll is in 
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 directory of my 
> machine. I had put this directory in the Path. I also tried 
> to copy the dll to the application exe directory. It has the 
> same result. I searched my machine. There is only one 
> System.Data.OracleClient.dll.  What else could be wrong? 
> 
> The following are  my new config and result. 
> 
> Config 
> --
> ---
>  type="log4net.Appender.ADONetAppender" > 
>  value="System.Data.OracleClient.OracleConnection, 
> System.Data.OracleClient, Version=1.1.4322.573, 
> Culture=neutral, PublicKeyToken=350c7afdc4c296b5" /> 
>  value="data source=[proddevdatabase];User 
> ID=[chris9];Password=[chris9]" /> 
>  value="INSERT INTO Log (Datetime, 
> Thread,Log_Level,Logger,Message) VALUES 
> (:log_date,:thread,:log_level,:logger, :message)" /> 
>  
>  .. 
> --
> --- 
> 
> 
> Result 
> --
> --
> log4net:ERROR [ADONetAppender] Failed to load connection type 
> [System.Data.Oracl eClient.OracleConnection, 
> System.Data.OracleClient, Version=1.1.4322.573, Cultur 
> e=neutral, PublicKeyToken=350c7afdc4c296b5]
> System.IO.FileNotFoundException: File or assembly name 
> System.Data.OracleClient,  or one of its dependencies, was not found. 
> File name: "System.Data.OracleClient" 
>at System.Type.GetType(String typeName, Boolean throwOnError) 
>at log4net.Appender.ADONetAppender.ResolveConnectionType() 
> 
> === Pre-bind state information ===
> LOG: DisplayName = System.Data.OracleClient, 
> Version=1.1.4322.573, Culture=neutr al, 
> PublicKeyToken=350c7afdc4c296b5
>  (Fully-specified)
> LOG: Appbase = C:\hv\HF 
> Security\Log4net\log4net-1.2.0-beta8\examples\net\1.0\Tu
> torials\ConsoleApp\cs\build\debug\
> LOG: Initial PrivatePath = NULL
> Calling assembly : log4net, Version=1.2.0.30714, 
> Culture=neutral, PublicKeyToken =b32731d11ce58905. 
> ===
> --
> -- 
> 
> I appreciate it. 
> 
> Ping Xie
> 
> CACI
> 4831 Walden Lane
> Lanham, MD 20706
> [EMAIL PROTECTED]
> (301) 306-8200 - Main
> (301) 306-2829 - Direct
> 
> 
> 
> 
>   "Nicko Cadell" <[EMAIL PROTECTED]> 
> 
> 08/11/2004 09:36 AM 
> Please respond to "Log4NET User" 
> To:"Log4NET User"  
> cc: 
> Subject:RE:  Error using ADONetAppender
> 
> 
> 
> 
> > I'm try to log messages to Oracle database. I got the 
> following debug 
> > errors when run my application.
> > 
> > --
> > -
> > log4net:ERROR [ADONetAppender] Failed to load connection type 
> > [System.Data.Oracl 
> eClient.OracleConnection,System.Data.OracleClient,
> > Version=1.2.0.30714, Culture= 
> neutral,PublicKeyToken=b32731d11ce58905]
> > System.IO.FileLoadException: The located assembly's manifest 
> > definition with nam e 'Sy

RE: Error using ADONetAppender

2004-08-11 Thread Ping Xie

Nicko,

Thanks a lot for your help. The dll
is successfully loaded using the version number and public key token given
by .NET Reflector. Since oracle bin directory is in the system path in
my machine, it works without copying them to the system32 directory. 

Thanks again.

Ping








"Nicko Cadell" <[EMAIL PROTECTED]>
08/11/2004 02:23 PM
Please respond to "Log4NET User"
        
        To:
       "Log4NET User" 
        cc:
       
        Subject:
       RE: Error using ADONetAppender


Looking at the assembly with the file system properties
and the sn.exe
tool seems to be giving a different set of results to the .NET
Reflector.

The .NET Reflector (http://www.aisto.com/roeder/dotnet) thinks that the
strong name for the assembly is:

System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089

I am not sure why this is different to the Public key token displayed by
sn.exe. Try the above details.

Also the System.Data.OracleClient references the following DLLs:

mtxoci8.dll
oci.dll
oramts.dll

I am assuming that these either come with the OracleClient or are part
of the Oracle client tools for windows. These DLLs need to be located
either in the windows system32 directory or the application bin
directory for the Windows DLL loader to find them.

Nicko


> -Original Message-
> From: Ping Xie [mailto:[EMAIL PROTECTED] 
> Sent: 11 August 2004 16:23
> To: Log4NET User
> Subject: RE: Error using ADONetAppender
> 
> 
> Nicko, 
> 
> Thank you very much for your response. I found out the 
> version number and public key token of 
> System.Data.OracleClient assembly and modified my 
> configuration file. But I still got the same error. 
> 
> System.Data.OracleClient.dll is in 
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 directory of my 
> machine. I had put this directory in the Path. I also tried 
> to copy the dll to the application exe directory. It has the 
> same result. I searched my machine. There is only one 
> System.Data.OracleClient.dll.  What else could be wrong? 
> 
> The following are  my new config and result. 
> 
> Config 
> --
> ---
> 
> type="log4net.Appender.ADONetAppender" > 
>                    

> value="System.Data.OracleClient.OracleConnection, 
> System.Data.OracleClient, Version=1.1.4322.573, 
> Culture=neutral, PublicKeyToken=350c7afdc4c296b5" /> 
>                    
        
> value="data source=[proddevdatabase];User 
> ID=[chris9];Password=[chris9]" /> 
>                    
        
> value="INSERT INTO Log (Datetime, 
> Thread,Log_Level,Logger,Message) VALUES 
> (:log_date,:thread,:log_level,:logger, :message)" /> 
>                    
 
>                    
 .. 
> --
> --- 
> 
> 
> Result 
> --
> --
> log4net:ERROR [ADONetAppender] Failed to load connection type 
> [System.Data.Oracl eClient.OracleConnection, 
> System.Data.OracleClient, Version=1.1.4322.573, Cultur 
> e=neutral, PublicKeyToken=350c7afdc4c296b5]
> System.IO.FileNotFoundException: File or assembly name 
> System.Data.OracleClient,  or one of its dependencies, was not
found. 
> File name: "System.Data.OracleClient" 
>    at System.Type.GetType(String typeName, Boolean throwOnError)

>    at log4net.Appender.ADONetAppender.ResolveConnectionType()

> 
> === Pre-bind state information ===
> LOG: DisplayName = System.Data.OracleClient, 
> Version=1.1.4322.573, Culture=neutr al, 
> PublicKeyToken=350c7afdc4c296b5
>  (Fully-specified)
> LOG: Appbase = C:\hv\HF 
> Security\Log4net\log4net-1.2.0-beta8\examples\net\1.0\Tu
> torials\ConsoleApp\cs\build\debug\
> LOG: Initial PrivatePath = NULL
> Calling assembly : log4net, Version=1.2.0.30714, 
> Culture=neutral, PublicKeyToken =b32731d11ce58905. 
> ===
> --
> -- 
> 
> I appreciate it. 
> 
> Ping Xie
> 
> CACI
> 4831 Walden Lane
> Lanham, MD 20706
> [EMAIL PROTECTED]
> (301) 306-8200 - Main
> (301) 306-2829 - Direct
> 
> 
> 
> 
>                  "Nicko
Cadell" <[EMAIL PROTECTED]> 
> 
> 08/11/2004 09:36 AM 
> Please respond to "Log4NET User"        

>         To:        "Log4NET
User"  
>         cc:         
>         Subject:        RE:
 Error using ADONetAppender
> 
> 
> 
> 
> > I'm try to log messages to Oracle database. I got the 
> following d