Thank you for the replies Marc and Aaron, the error was somewhat unrelated
-- it was picking up a bad log4net assembly reference.

However, I've now fixed the problem by specifying the ConfigFile property in
the DOMConfigurator attribute and have added a post-build event to copy over
the config file to the project's output directory. All seems to be working
nicely now.

-----Original Message-----
From: Hart, Aaron [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2005 17:35
To: Log4NET User
Subject: RE: Correct way to use DOMConfiguratorAttribute

I could be wrong but I believe it's looking for your application's
config file for the log4net information. You need to name the config
file based on the application that is using PPF.Import, not based on the
DLL name.

Aaron

-----Original Message-----
From: Paul Ingles [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 18, 2005 7:11 AM
To: [email protected]
Subject: Correct way to use DOMConfiguratorAttribute

Hi,

This follows somewhat on from my post a few days ago.

I have a class library that uses log4net to provide logging, this is
then
consumed within a standard console application.

I've applied the attribute to the class library assembly within the
project's AssemblyInfo.cs file as follows:

[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",
Watch=true)]

The class library assembly is named PPF.Import, and so I've named the
log4net config file PPF.Import.log4net.

When I try and run the console app a file load exception is thrown:
"Additional information: The located assembly's manifest definition with
name 'log4net' does not match the assembly reference."

So, I've tried renaming the log4net configuration file to
PPF.Import.ImporterApp.exe.log4net, and placed it within the console
application's output directory but the problem remains.

I then tried applying the DOMConfigurator attribute to the console
application's assembly, hoping that would pick up the log4net
configuration
file but again no joy.

Thanks again for any suggestions.

Paul

Reply via email to