The configuration section for Logging cannot be found in the configuration source

Topics: Enterprise Library Core, Logging Application Block
Oct 1, 2014 at 10:25 PM
Hello,

After I upgraded VS project to .NET 4.0, my enterprise lib DLLs version 3.1.0.0 stopped working on Windows 2003/IIS 6. Note this works fine on my local Windows 8/IIS7.5.
DLLs are not GACed and they are in bin. Would 3.1 DLLs work with .NET 4.0 or do I need to upgrade? Any idea how to fix it?

I am using following DLLs:
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.ObjectBuilder.dll


System.Configuration.ConfigurationErrorsException: The configuration section for Logging cannot be found in the configuration source. at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolderCustomFactory.ValidateLoggingSettings(LoggingSettings loggingSettings) at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolderCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) at Microsoft.Practices.ObjectBuilder.BuilderBase1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.ObjectBuilder.BuilderBase1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer() at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log) at SAMLogger.LabWrapper.WriteInternal(Object message, TraceEventType severity) in e:\B\2\BCI\DEV_SamV2\Sources\Web\Service\BCI.Web.Service.SAM.V2\SendAMessageService\SAMLogger\LabWrapper.cs:line 23 at BBCSOAPExt.BBCSoapExt.WriteInput(SoapMessage message) at BBCSOAPExt.BBCSoapExt.ProcessMessage(SoapMessage message) at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

Config setting:
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<loggingConfiguration name="Logging Application Block" tracingEnabled="false" defaultCategory="" logWarningsWhenNoCategoriesMatch="false">

Thanks.
Manish
Oct 4, 2014 at 6:16 PM
EntLib3 should work with IIS6. If the application is working on one machine and not another then that points to the issue being environmental or related to deployment.

The message says that the loggingConfiguration section could not be found in the web.config. Verify that the web.config was deployed successfully. Also, check where the virtual root is point to and double check the web.config in that location (to see if the loggingConfiguration is present).

Was IIS6 with .NET 4.0 working previously? If not then perhaps IIS is not configured properly?


~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Marked as answer by manishkj on 10/4/2014 at 11:14 AM
Oct 4, 2014 at 7:14 PM
Thanks for your reply. At first it looked like Enterprise Library issue. Then I investigated config inheritance issue listed here as this is a nested website. As it turns out, root folder was missing due to which website could not access web.config. Adding that folder fixed everything. Thanks again!
http://www.asp.net/whitepapers/aspnet4/breaking-changes
Oct 4, 2014 at 7:47 PM
Great to hear that it's working now.