Unrecognized element 'extensionConfig'. (

Topics: Enterprise Library Core, Policy Injection Application Block
Mar 4, 2013 at 3:03 PM
I am following link

http://www.sadev.co.za/content/tripping-over-logs-story-unity-part-4

but getting error Unrecognized element 'extensionConfig'. (

please guide
Mar 4, 2013 at 3:35 PM
Edited May 1, 2013 at 9:41 PM
That article was written for Unity 1. You are probably using Unity 2.1 You can look at Configuring a Container for Interception for a current example of XML configuration. The example given there is:
<container name="YourContainer">
  <extension type="Interception" />
  <register type="TypeToIntercept">
    <interceptor type="VirtualMethodInterceptor" />
    <addInterface type="IServiceProvider" />
    <addInterface type="IComponent" />
    <interceptionBehavior type="CustomBehavior" name="someBehavior" />
  </register>
</container>
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Mar 4, 2013 at 4:49 PM
Edited Mar 4, 2013 at 5:15 PM
after adding
<sectionExtension type="Microsoft.Practices.Unity.InterceptionExtension.Configuration.InterceptionConfigurationExtension, Microsoft.Practices.Unity.Interception.Configuration"/>

and above it started working but not as expected behavior

I need to make the
http://www.sadev.co.za/content/tripping-over-logs-story-unity-part-4
work as logically expected.

I had achived same via code but not via config

Please guide
Mar 4, 2013 at 5:48 PM
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
</configSections>
<unity>
    <typeAliases>
        <typeAlias alias="Logger"         type="BigSystem.ConsoleLogger, BigSystem"/>
        <typeAlias alias="ILogger"          type="BigSystem.ILogger, BigSystem"/>
        <typeAlias alias="singleton"        type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
        <typeAlias alias="Worker"           type="BigSystem.Worker, BigSystem"/>
        <typeAlias alias="IWorker"          type="BigSystem.IWorker, BigSystem"/>
        <typeAlias alias="transparentProxy" type="Microsoft.Practices.Unity.InterceptionExtension.TransparentProxyInterceptor, Microsoft.Practices.Unity.Interception" />
    </typeAliases>
<sectionExtension type="Microsoft.Practices.Unity.InterceptionExtension.Configuration.InterceptionConfigurationExtension, Microsoft.Practices.Unity.Interception.Configuration"/>
    <containers>     
    <container>
      <extension            type="Interception"/>            

      <register             type="IWorker" mapTo="Worker">            
        <interceptor          type="transparentProxy"/>               
      </register>

      <register             type="ILogger" mapTo="Logger">
        <interceptor          type="transparentProxy"/>
      </register>

    </container>        
    </containers>
</unity>
</configuration>

i have added this...but i know invoke wont fire as interception will not work , I need the config entries
Mar 4, 2013 at 7:23 PM
Edited May 1, 2013 at 9:42 PM
Assuming that the approach in the Unity 1 article still works with Unity 2 (in general, it should) then it looks to me like you are missing the policyInjection configuration:
      <register type="IWorker" mapTo="Worker">            
        <interceptor type="transparentProxy"/>               
        <policyInjection />
      </register>
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Mar 5, 2013 at 9:47 AM
Thanks a lot...
it worked