CustomExceptionHandler ctor and Unity

Topics: Exception Handling Application Block
Oct 5, 2010 at 2:17 PM

Can anyone please tell me how to "configure" the constructor in Unity (EntLib 5/Unity 2.0) so that I can inject a custom logger?

the idea is this:

ctor:

public CustomHandler(NameValueCollection attribute, ILogStuff logger)

{

   this.logger=logger;

}

in the config i'd register the CustomHandler like so:

<register type="CustomHandler" name="ExceptionHandler">
        <constructor>

          <param value="NameValueCollection" name="attribute"></param>
          <param value="ILogStuff" name="logger"></param>
        
        </constructor>
      </register>

the maroon parameter being questionable.

I would of course also register the ILogStuff itfc with the container.

No matter what I do, it's always the single parameter ctor of my CustomHandler class that gets called...any ideas?

Thanks in advance

Oct 5, 2010 at 2:47 PM
Edited Oct 5, 2010 at 3:01 PM

This was answered in the Unity forum - http://unity.codeplex.com/Thread/View.aspx?ThreadId=47121

If you have further questions on this, please post it in the the Unity forum.

 

Sarah Urmeneta
Global Technology and Solution
Avanade, Inc.
entlib.support@avanade.com