Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Configuration Section Tags Are Not Recognized


View products that this article applies to.

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'

↑ Back to the top


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.

↑ Back to the top


Resolution

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

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


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:

↑ Back to the top


Keywords: KB311091, kbreadme, kbpending, kberrmsg, kbconfig, kbbug

↑ Back to the top

Article Info
Article ID : 311091
Revision : 7
Created on : 5/8/2007
Published on : 5/8/2007
Exists online : False
Views : 376