Microsoft Knowledge Base Email Alertz

KBAlertz.com: If you add configuration section tags before the <configSections> configuration section in the Machine.config file, you may receive the following error message when you run your ASP.NET applications:

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 311091 - Last Review: May 8, 2007 - Revision: 2.4

BUG: Configuration Section Tags Are Not Recognized

This article was previously published under Q311091

On This Page

SYMPTOMS

If you add configuration section tags before the <configSections> configuration section in the Machine.config file, you may receive the following error message when you run your ASP.NET applications:
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.

Parse Error Message: Unrecognized configuration section 'tagname'

CAUSE

The <configSections> section in the Machine.config file defines the configuration sections that can be used for the given configuration hierarchy within an application. If you use a configuration section tag before the <configSections> section (for example, the <runtime> or <appSettings> tag), you receive the above-mentioned error message because the configuration section handler has not yet been loaded.

This problem can also occur if the configuration section does not exist or if the configuration section handler is not defined.

RESOLUTION

To work around this problem, add the configuration section tag after the <configSections> section.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This problem does not occur when you add a configuration section tag to the Web.config application configuration file because the Machine.config file in which the handler is defined for this section has already been processed.

Steps to Reproduce the Behavior

  1. Open the Machine.config file in Notepad. Machine.config is typically located in \WINNT\Microsoft.NET\Framework\<version number>\CONFIG\.
  2. Move the following <appSettings> code block so that it appears before the <configSections> section:
    <appSettings>
            <add key="XML File Name" value="myxmlFileName.xml"/>
    </appSettings>
    					
  3. Save your changes to Machine.config.
  4. View any existing .aspx page. You receive the above-mentioned error message.
  5. Move the <appSettings> code block to the end of Machine.config just before the </configuration> section, and save your changes to Machine.config.
  6. View an existing .aspx page. You no longer receive the error message.

REFERENCES

For an overview of configuration files and predefined configuration section handlers that are included with the .NET Framework, refer to the following topic in the Microsoft .NET Framework Software Development Kit (SDK) documentation:
Format of ASP.NET Configuration Files
http://msdn2.microsoft.com/en-us/library/ackhksh7(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/ackhksh7(vs.71).aspx)

APPLIES TO
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
Keywords: 
kbbug kbconfig kberrmsg kbpending kbreadme KB311091
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please