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 exception.
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.
blog comments powered by Disqus