EntLib 5/Unity 2: How do I configure policy injection with Unity interception

Topics: Logging Application Block, Policy Injection Application Block, Pre-release discussions
Apr 15, 2010 at 8:31 PM

Hi all,

I’m currently playing with the Ent Lib 5.0 Beta 2 trying to create a proof of concept using the Microsoft.Practices.EnterpriseLibrary.Logging.PolicyInjection.LogCallHandler or any other log handler to work with the new Unity 2 configuration file schema.  The help documentation says “Enterprise Library contains a series of prebuilt call handlers that you can use with Unity interception. These handlers use the other blocks in Enterprise Library to implement common crosscutting concerns such as logging, ...”  However I can’t get it to work and I can’t find any examples other than the “GlobalCountCallHandler” which isn’t very helpful.  Anyone have any examples?

Currently my unity configuration schema is as follows...the only part I can’t figure out is where you see the big ?s



      <add alias="IUnityTest" type="HttpService.IUnityTest, HttpService" />

      <add alias="UnityTest" type="HttpService.UnityTest, HttpService" />


    <sectionExtension type="Microsoft.Practices.Unity.InterceptionExtension.Configuration.InterceptionConfigurationExtension, Microsoft.Practices.Unity.Interception.Configuration" />



      <extension type="Interception" />


      <register type="IUnityTest" mapTo="UnityTest" >

        <interceptor type="VirtualMethodInterceptor"/>



        <policy name="Policy">

            <matchingRule type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.MemberNameMatchingRule, Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=5.0.315.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

                name="Member Name Matching Rule">











Thanks in advance,


Apr 16, 2010 at 12:47 AM

Please post this in the Unity forum.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.