I am trying to learn log4Net, however, I do not have Visual Studio installed in my PC (due to lack of Administrative Privileges). And so, I am trying out my code by writing them in good old Notepad of Windows XP. In this, if I want to add a reference to log4net.dll, how do I do it?
Sorry for being .NET naive. I am just learning!
For instance, this is the sample code that I am trying to execute. Tutorial is available here .
using System;
namespace Tutorial1_GettingStarted
{
class Program
{
static void Main( string[] args )
{
log4net.Config.BasicConfigurator.Configure();
log4net.ILog log = log4net.LogManager.GetLogger( typeof( Program ) );
log.Debug( "Hello World!" );
log.Info( "I'm a simple log4net tutorial." );
log.Warn( "... better be careful ..." );
log.Error( "ruh-roh: an error occurred" );
log.Fatal( "OMG we're dooooooomed!" );
Console.ReadLine(); // so you can read the output
}
}
}
编译时,使用/r
开关 :
csc Program.cs /r:Log4Net.dll
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.