InvalidOperationException for error logging on one server, works elsewhere

Topics: Exception Handling Application Block, General discussion, Logging Application Block
Aug 29, 2007 at 12:48 AM
The question is, what could be different about this server to cause this. We are also having problems with lines in the web.config for these objects generating error messages that they already exist, but when the lines are removed, we get the results pasted in below whenever an error is being handled.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

InvalidOperationException: The [Assembler] attribute is not set in the configuration object type Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.TraceListenerData.
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.GetAssemblerAttribute(Type type) +149
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.GetAssembler(TConfiguration objectConfiguration) +197
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory`2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +21
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.TraceListenerCustomFactory.Create(IBuilderContext context, TraceListenerData objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +20
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory`2.Create(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +70
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.TraceListenerCustomFactory.Create(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache, TraceListenerCache traceListenersCache) +55
Microsoft.Practices.EnterpriseLibrary.Logging.LogSourceCustomFactory.Create(IBuilderContext context, TraceSourceData objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache, TraceListenerCache traceListenersCache) +191
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolderCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +415
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +35
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +71
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +171
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +38
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +88
Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +310
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +128
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) +75
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IReadWriteLocator locator, IConfigurationSource configurationSource) +111
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IConfigurationSource configurationSource) +42
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer() +70
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log) +8
Ekaria.App.Merchandising.PlacementTool.ContextManager.LogIfError(String Category, String Message) in d:\20Builds\App\Merchandising\PlacementTool\PlacementToolSite\common\ContextManager.cs:152
Ekaria.App.Merchandising.PlacementTool.PageDetails.Page_Load(Object sender, EventArgs e) in d:\20Builds\App\Merchandising\PlacementTool\PlacementToolSite\Detail.aspx.cs:50
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Aug 29, 2007 at 1:40 AM
Hi,

Which version of EntLib are you using, and what does the configuration for the logging block look like for your failing server?
Are you using some custom logging trace listener?

Regards,
Fernando
Aug 29, 2007 at 2:33 AM
I can't show the logging block from here (I don't have access) but perhaps tomorrow.

This works on two different servers, both my dev machine, and another development server. I get logs on both machines.
It just doesn't work on the "staging" server for some reason.
We are using Enterprise Libarary 3.1.

I don't think we are doing anything custom. I have followed the minimal configuration specified in the various web pages I've found about the Enterprise Library Logging (athough none of the pages I've found were -ahem- models of great clarity). The one thing that could be different on this server is that in this case it is on a child URL of another application. On the other servers where it works just fine, it runs on its own independent webserver URL.

The parent application is also using logging and perhaps there are some conflicts about which handler it is using. None of the application code in this app is in any way dependent on the parent URL it just needs to be that way because that is how the app is presented to the users.
Aug 29, 2007 at 11:59 AM
Hi,

It's very likely there is an issue with the way multi-level logging configuration is merged. Will try to create a repro.

Fernando