Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code

Topics: Exception Handling Application Block
Apr 10, 2014 at 7:02 PM
I have this problem:

An exception of type 'Microsoft.Practices.ServiceLocation.ActivationException' occurred in Microsoft.Practices.ServiceLocation.dll but was not handled in user code.

Additional information: Activation error occured while trying to get instance of type ExceptionPolicyImpl, key "PolicyBLLFeeManagerUI".

This is my ExceptionHandling:

<exceptionHandling>
<exceptionPolicies>
  <add name="PolicyDALFeeManager">
    <exceptionTypes>
      <add name="All Exceptions" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="None">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="Exception" eventId="100" severity="Critical" title="PolicyDALFeeManager Exception"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="0" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
  <add name="PolicyBLLFeeManager">
    <exceptionTypes>
      <add name="All Exceptions" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="None">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="Exception" eventId="101" severity="Critical" title="PolicyBLLFeeManager Exception"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="0" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
  <add name="PolicyMddFeeManager">
    <exceptionTypes>
      <add name="All Exceptions" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="None">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="Exception" eventId="102" severity="Critical" title="PolcyMddFeeManager Exception"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="0" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
  <add name="PolicyRouterFeeManager">
    <exceptionTypes>
      <add name="All Exceptions" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="None">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="Exception" eventId="103" severity="Critical" title="Enterprise Library Exception Handling"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="0" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
</exceptionPolicies>
</exceptionHandling>
Apr 11, 2014 at 1:08 PM
Somewhere in the code it is trying to use the exception policy named "PolicyBLLFeeManagerUI". However, based on the posted configuration, "PolicyBLLFeeManagerUI" is not defined in the configuration. Maybe you meant to use "PolicyBLLFeeManager"?

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to