If you assembly is called Foo and your .DLL file is called Foo.dll, try
naming your file config file Foo.dll.log4net

FYI, I've found that when I am building and launching my program from
inside of Visual Studio ((i.e. pressing F5) the config file is not
found . I need build my project then launch the program from the Debug
directory where it was built. Everything may work fine for you.

- Ron

--- mailing <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'm trying to use log4net in a class library, so there's no .config
> file or global.asax file. Usually I have the following assembly
> attribute in the global.asax.cs to instruct log4net where to find the
> config file (named <myassembly>.dll.log4net):
> 
> [assembly:
> log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",
> Watch=true)]
> 
> Since there's no global.asax.cs, I have the above assembly attribute
> in one of the class files in the class library. Is this the wrong
> place to put it? It doesn't appear that log4net is reading the config
> file.
> 
> How do I get this to work in a class library like this?
> 
> Simon.
> 

Reply via email to