Unable to build sample WmiAppender in Log4Net 1.2.11 examples net 2.0

145 views Asked by At

I downloaded the Log4Net 1.2.11 source files from an Apache mirror site. IAfter unzipping, I was able to build the main Log4Net project.

When I try and build the example code for .net 2.0 it fails because of ilformed calls calls to a method.

log4net.Util.LogLog.Warn(GetType(), "WmiAppender: You have tried to set a null error-handler.");

The error looks like this:

Argument 1: cannot convert from 'System.Type' to 'string'

This makes sense because the available prototypes in the log4net assembly looks like this:

public static void Warn(string message);
public static void Warn(string message, Exception exception);

I get an additional error to the same method for a similar reason.

My question is how can anybody build this code?

I must be missing something because I'm not seeing anybody else asking this question.

1

There are 1 answers

0
Rich Shealer On BEST ANSWER

I rebuilt the log4Net.dll and saw the method prototype change to:

public static void Warn(Type source, string message);
public static void Warn(Type source, string message, Exception exception);

In order to build it I needed to install NAnt and compile from the command line. NAnt required me to Unblock the downloaded ZIP (Under the file properties in Explorer) which wasn't immediately obvious.