views:

45

answers:

1

Hello...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   
    }   
  }   
}  
+4  A: 

When you compile, use the /r switch:

csc Program.cs /r:Log4Net.dll
Jon Skeet