Resolution failed exception

Topics: Exception Handling Application Block
Mar 28, 2011 at 12:17 PM

Getting the following error when trying to resolve the exceptionManger instance

Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type ConfigurationChangeEventSource cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManagerImpl,ExceptionManager.__default__ (mapped from Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager, (none))
  Resolving parameter "exceptionPolicies" of constructor Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManagerImpl(System.Collections.Generic.IEnumerable`1[[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] exceptionPolicies, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Instrumentation.IDefaultExceptionHandlingInstrumentationProvider instrumentationProvider)
    Resolving Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl,CustodyPostingDataPolicy
    Resolving parameter "policyEntries" of constructor Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl(System.String policyName, System.Collections.Generic.IEnumerable`1[[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] policyEntries)
      Resolving Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry,CustodyPostingDataPolicy.All Exceptions
      Resolving parameter "handlers" of constructor Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry(System.Type exceptionType, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.PostHandlingAction postHandlingAction, System.Collections.Generic.IEnumerable`1[[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.IExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] handlers, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Instrumentation.IExceptionHandlingInstrumentationProvider instrumentationProvider)
        Resolving Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler,CustodyPostingDataPolicy.All Exceptions.Logging Exception Handler (mapped from Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.IExceptionHandler, CustodyPostingDataPolicy.All Exceptions.Logging Exception Handler)
        Resolving parameter "writer" of constructor Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler(System.String logCategory, System.Int32 eventId, System.Diagnostics.TraceEventType severity, System.String title, System.Int32 priority, System.Type formatterType, Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter writer)
          Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl,LogWriter.__default__ (mapped from Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, (none))
          Resolving parameter "structureHolder" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl(Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder structureHolder, Microsoft.Practices.EnterpriseLibrary.Logging.Instrumentation.ILoggingInstrumentationProvider instrumentationProvider, Microsoft.Practices.EnterpriseLibrary.Logging.ILoggingUpdateCoordinator updateCoordinator)
            Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder,LogWriterStructureHolder.__default__ (mapped from Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder, (none))
            Resolving parameter "traceSources" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder(System.Collections.Generic.IEnumerable`1[[Microsoft.Practices.EnterpriseLibrary.Logging.Filters.ILogFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] filters, System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] traceSourceNames, System.Collections.Generic.IEnumerable`1[[Microsoft.Practices.EnterpriseLibrary.Logging.LogSource, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] traceSources, Microsoft.Practices.EnterpriseLibrary.Logging.LogSource allEventsTraceSource, Microsoft.Practices.EnterpriseLibrary.Logging.LogSource notProcessedTraceSource, Microsoft.Practices.EnterpriseLibrary.Logging.LogSource errorsTraceSource, System.String defaultCategory, System.Boolean tracingEnabled, System.Boolean logWarningsWhenNoCategoriesMatch, System.Boolean revertImpersonation)
              Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogSource,General
              Resolving parameter "traceListeners" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LogSource(System.String name, System.Collections.Generic.IEnumerable`1[[System.Diagnostics.TraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] traceListeners, System.Diagnostics.SourceLevels level, System.Boolean autoFlush, Microsoft.Practices.EnterpriseLibrary.Logging.Instrumentation.ILoggingInstrumentationProvider instrumentationProvider)
                Resolving Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.ReconfigurableTraceListenerWrapper,Event Log Listener (mapped from System.Diagnostics.TraceListener, Event Log Listener)
                Resolving parameter "coordinator" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.ReconfigurableTraceListenerWrapper(System.Diagnostics.TraceListener wrappedTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.ILoggingUpdateCoordinator coordinator)
                  Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LoggingUpdateCoordinator,ILoggingUpdateCoordinator.__default__ (mapped from Microsoft.Practices.EnterpriseLibrary.Logging.ILoggingUpdateCoordinator, (none))
                  Resolving parameter "eventSource" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LoggingUpdateCoordinator(Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConfigurationChangeEventSource eventSource, Microsoft.Practices.EnterpriseLibrary.Logging.Instrumentation.ILoggingInstrumentationProvider instrumentationProvider)
                    Resolving Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConfigurationChangeEventSource,(none)

Thanks

Mar 29, 2011 at 2:11 AM

I've come across the same concern in this thread and the user's finding was that there was a missing assembly.  He didn't mention what was the assembly though but see if you referenced the Microsoft.Practices.EnterpriseLibrary.Common assembly.

 

Sarah Urmeneta
Global Technologies & Solutions
Avande, Inc.
entlib.support@avanade.com

Apr 15, 2011 at 2:04 AM

Hi,

 

Thanks for the reply.. I have referenced the Microsoft.Practices.EnterpriseLibrary.Common assembly.

Apr 15, 2011 at 2:10 AM

Are you resolving from a UnityContainer or getting it from EnterpriseLibraryContainer.Current?  If it's from a UnityContainer, make sure you add the EnterpriseLibraryCoreExtension.

container.AddNewExtension<EnterpriseLibraryCoreExtension>();

 

Sarah Urmeneta
Global Technologies & Solutions
Avande, Inc.
entlib.support@avanade.com

Apr 15, 2011 at 2:14 AM

thanks. It is working fine.

Apr 22, 2015 at 7:04 PM
How do u do it in EL 6 with Unity 3, there is no EnterpriseLibraryCoreExtension ?!