سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top