logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CheeHong <cheeho...@hotmail.com>
Subject Re: Log4Net failed in .net 3.5 Framework
Date Sun, 22 Jun 2008 04:41:27 GMT

Hello,

Thanks for your prompt reply. Appreaciated.

I know there are certain restrictions on App.config for adding custom
section handlers. But I didn't quite understand why such errors were not
reported when I was using VS 2003 ( with log4net ) ? 

It would be quite troublesome for me to re-structure my App.config file as I
built my project flow according to format as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>  
    <Hello>
       .....
       .....
    </Hello>
    < Hello2>
    </Hello2> 
  </appSettings>
  </configuration>

Is anyone facing this issue as well ? How come I was able to run smoothly
without any errors in VS2003 but not with VS2008 ? 

Chee Hong



Ron Grabowski wrote:
> 
> If the exception message mentioned your app.config being malform perhaps
> you should use a well formed app.config. This is incorrect:
> 
>    <appSettings>  
>     <Hello>
>        .....
>        .....
>     </Hello> 
>   </appSettings>
> 
> AppSettings can only contain <add /> nodes:
> 
>  <appSettings>
>   <add key="log4net.Internal.Debug" value="true" />
>  </appSettings>
> 
> Since new version of the Framework are backwards compatible with previous
> versions, the latest version of the log4net is compatible with version 3.5
> of the Framework.
> 
> ----- Original Message ----
> From: CheeHong <cheehongh@hotmail.com>
> To: log4net-dev@logging.apache.org
> Sent: Saturday, June 21, 2008 5:49:19 AM
> Subject: Log4Net failed in .net 3.5 Framework
> 
> 
> Hello,
> 
> I had jus migrated my VS2003 project to VS2008 Evaluation version. I found
> out that my log4net is giving me an error in which previously it didn't
> complain.
> 
> Function I called is LogManager.GetLogger(name)
> 
> It gives me "TypeInitializationException was unhandled" error, with the
> inner exception as "The type initializer for 'log4net.helpers.LogLog'
> threw
> an exception". Go in further it mention about my app.config file is having
> unrecognised element.
> 
> My app.config has the following structure:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
>   <appSettings>  
>     <Hello>
>        .....
>        .....
>     </Hello> 
>   </appSettings>
>   </configuration>
> 
> It is complaining about <Hello> being the unrecognized element. But I am
> able to use log4net in VS2003 without any errors. Could it be due to the
> incompatibility of using log4net on VS2008 ?
> 
> Is there a log4net version for .net framework 3.5 ? 
> 
> Can anyone help me on this, any suggestions are welcomed.
> 
> Thanks in advance.
> 
> Regards,
> Chee Hong
> -- 
> View this message in context:
> http://www.nabble.com/Log4Net-failed-in-.net-3.5-Framework-tp18042667p18042667.html
> Sent from the Log4net - Dev mailing list archive at Nabble.com.
> 
> 

-- 
View this message in context: http://www.nabble.com/Log4Net-failed-in-.net-3.5-Framework-tp18042667p18051198.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.


Mime
View raw message