You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by impact99999 <ho...@gmx.de> on 2010/07/14 17:55:54 UTC

log4net configuration problems with vs2010 installed side by side with vs2008

Hello,
i have installed both VS2010 and VS2008 on my computer.

To configure log4net i use the following statement in AssemblyInfo.cs of my
project:
C#-Code:
[assembly: log4net.Config.XmlConfigurator(Watch = true)] 

I think that is the most common way to use a log4net configuration in the
applications .config file, isnĀ“t it ? The problem is: logging is only
working when starting the application out of vs in release-mode without
debugging !


If i want to start the application with attatched debugger and working
logging, i have to insert this command into my program.cs application entry
method:

C#-Code:
XMLConfigurator.Configure() 


The funny thing is: When i am using the command in program.cs, the
configuration using the assemblyinfo.cs attribute is ALSO working. Here is
the proof:

log4net: XmlConfigurator: configuring repository
[log4net-default-repository] using file [D:\.....exe.Config] watching for
file updates
log4net: XmlConfigurator: configuring repository
[log4net-default-repository] using file [D:\.....exe.Config]

Does anybody know what is going on ?


Regards, 
impact99999
-- 
View this message in context: http://old.nabble.com/log4net-configuration-problems-with-vs2010-installed-side-by-side-with-vs2008-tp29163615p29163615.html
Sent from the Log4net - Users mailing list archive at Nabble.com.


*Solved* Re: log4net configuration problems with vs2010 installed side by side with vs2008

Posted by impact99999 <ho...@gmx.de>.
I found the solution by debugging the log4net source:

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

has to be placed in the AssemblyInfo.cs of the Assembly that first fires a
call to LogManager.GetLogger() !
-- 
View this message in context: http://old.nabble.com/log4net-configuration-problems-with-vs2010-installed-side-by-side-with-vs2008-tp29163615p29174490.html
Sent from the Log4net - Users mailing list archive at Nabble.com.