Unrecognized element 'interceptor'.

Jun 23, 2011 at 3:51 AM
Edited Jun 23, 2011 at 3:52 AM

Hi All,

I want to resolve the instance with the PIAB. But When I resolve the instance It will throw the exception:

Unrecognized element 'interceptor'. (F:\Coder\EnterpriseLibrary\EFSolution\InterceptionBlockApplication\bin\Debug\InterceptionBlockApplication.vshost.exe.Config line 60)

The follow is my configuration:

 <unity xmlns="http://schemas.microsoft.com/practices/2010/unity">    

 <alias alias="IDAL" type="InterceptionBlockApplication.IDAL,InterceptionBlockApplication"/>  

  <alias alias="DALTest" type="InterceptionBlockApplication.DALTest,InterceptionBlockApplication"/>
    <container name="DALTest">
      <extension type="Interception"/>          

        <register type="IDAL" mapTo="DALTest" name="DALTest">      

        <interceptor isDefaultForType="true" type="VirtualMethodInterceptor"/>    

        </register>            

        <interception>        

        <policy name="TestPolicy">          

        <matchingRule name="Method Signature Matching Rule"  type="MemberNameMatchingRule">          

         <method name="MethodA"></method>            

        <method name="MethodB"></method>          

       </matchingRule>          

       <callHandler name="MyLogCallHandler" type="InterceptionBlockApplication.MyLogCallHandler, InterceptionBlockApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">

       </callHandler>        

     </policy>      

   </interception>
   </container>  

</unity>

 

Is there any mistake for me? I hope you could  give some advices.

Thanks.

David

Jun 23, 2011 at 7:07 AM

I should add the <PolicyInjection/> with the register class.

Jun 23, 2011 at 8:51 AM

Hi,

Try adding

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

outside the container node.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jun 24, 2011 at 1:40 AM
Edited Jun 24, 2011 at 1:40 AM

Thank you for your Advices.