|
From: Geoghegan, W. A (Willie) <wil...@in...> - 2010-09-24 16:35:13
|
Thanks, that fixed it. I had not used that particular syntax ( :this( … ) ) before and I did not follow your suggestion correctly.
I ended up with something like this:
MyAdapter : AbstractCachingLoggerFactoryAdapter
{
public MyAdapter(NameValueCollection properties)
{
//No code here because I don’t need any config params right now
}
public MyAdapter()
: this(new NameValueCollection())
{
//Parameterless constructor so I don’t have to put a dummy param in the app.config file
}
}
Thanks again.
From: ken...@gm... [mailto:ken...@gm...] On Behalf Of Kenneth Xu
Sent: Friday, September 24, 2010 10:16 AM
To: Geoghegan, William A (Willie)
Subject: Re: [Netcommon-developer] Runtime error with custom LoggerFactoryAdapter/Logger
This is because you didn't derive the the correct constructor. That's way I ask you to use ': this( new NameValueCollection()){}' in my previous email.
On Fri, Sep 24, 2010 at 11:12 AM, Geoghegan, William A (Willie) <wil...@in...> wrote:
If I try to add a parameterless constructor, it won’t compile because Common.Logging.Factory.AbstractCachingLoggerFactoryAdapter (from which I derived my adapter) does not contain a constructor that takes 0 arguments.
|