I am trying to integrate log4Net assembly in the nant-nunit build framework.
The moment I add this line
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
in HelloWorld.cs, I get an error while trying to run a test using HelloWorldTest.cs.
My log4Net config file is HelloWorld.dll.config and is in the same dir as the dll itself.
The test class cannot instantiate HelloWorld...
Failures:
1) Hello.HelloWorldTest.getStr : The type initializer for "Hello.HelloWorld" threw an exception.
at Hello.HelloWorld..ctor()
at Hello.HelloWorldTest.getStr() in C:\OEMS\dev\src\HelloWorldTest.cs:line 12
I am C# newbie, so if this a stupid question, I am sorry but I appreciate any help.
Thanks
Anand
HelloWorld.cs -------------
using log4net; [assembly: log4net.Config.DOMConfigurator(Watch=true)]
namespace Hello {
using System;
public class HelloWorld {
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private String str = "";
public HelloWorld() {
str = "Hello World";
} public String getStr() {
return str;
}
}
}_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
