Using Log4Net from a COM+ Application

I spent far too much time on Friday trying to make log4net work in a COM+ application.

Someone else had done part of the work necessary, by creating an application.config for the COM+ application and setting a custom Application Root Directory. This was enough to ensure that most of the managed code in the application got their configuration settings; log4net being the

It took some additional work to realize that we needed to add two assembly attributes:

[assembly: log4net.Config.Repository("unique-name")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile="application.config")]

The repository name just needs to be a unique string. We used the name of the assembly.

2 Comments

  • Did you ever get this to work properly?? I'm trying to do this now and I'm not finding a lot of information out there. Is the application.config name just that application.config or is it .config or .exe.config? I appreciate any help you can lend on this issue. Thanks

  • It is actually .config it also took me some time to figure this out :-P

Comments have been disabled for this content.