all groups > visual studio .net enterprise tools > august 2006 >
You're in the

visual studio .net enterprise tools

group:

loggingconfiguration error


loggingconfiguration error aaron NO[at]SPAM aaconsult.com.au
8/16/2006 5:40:45 PM
visual studio .net enterprise tools:
Hi Guys,

I am trying to make a simple one-line call with the Logger in my
ASP.Net web application.
I have added the reference to
Microsoft.Practices.EnterpriseLibrary.Logging and the using statement.
I have ran the configuration tool over my web.config and added the
sinks, formatters and categories that I would like.
My config file validates and has been saved. All the XML looks fine in
the web.config file and I can see the two other .config files that its
created. Those are added inside my Solution within Visual Studio
(loggingconfiguration.config and
loggingdistributorconfiguration.config).

When running the web application, after trying to narrow down the
error, I now just have a single button that onclick just fires off this
call:
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("TEST",
"Category1");

But I keep getting this server side error:

-------------

Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Invalid section name. The section
'loggingConfiguration' does not exist in the requested configuration
file 'C:/Inetpub/wwwroot/MyProject/web.config' or the file
'c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config'.
Make sure that the 'enterpriseLibrary.configurationSections'
configuration section exists in one of the files and that the section
'loggingConfiguration' is defined.

Source Error:


[No relevant source lines]

-------------

I have tried copying the two .config files into the web app's bin
directory and I have also given everyone full control to both config
files. I'm sure the XML seems intact, because the config tool generated
it. I am stumped as to why it still thinks this loggingconfiguration
setting is missing, when I can clearly see its there.

Can anyone shed some light on my problem??

Thanks a lot.

Aaron.
Re: loggingconfiguration error aaron NO[at]SPAM aaconsult.com.au
8/16/2006 5:52:14 PM

[quoted text, click to view]



Looks like I have just solved my own problem!

At the top of my web.config file, the configuration tool generated this
line:

<section name="enterpriselibrary.configurationSettings"
type="System.Configuration.IgnoreSectionHandler, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>

I was looking around some other applications that we have here that use
logging successfully, and I replaced the above line with this line:

<section name="enterpriselibrary.configurationSettings"
type="Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManagerSectionHandler,
Microsoft.Practices.EnterpriseLibrary.Configuration, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null" />

Now it works perfectly.
AddThis Social Bookmark Button