Only one <configSections> element is allowed. It must be the first child element of the root <configuration> element-HTTP Error 500.19

Source: Internet
Author: User
Tags connectionstrings

This is the first time I have encountered this error, I have not paid much attention to the placement order of elements in the configuration file. This time when debugging an ASP. NET MVC project, it suddenly burst into an HTTP error 500.19 error, prompting that the requested page could not be accessed because the page's related configuration data is invalid.

Based on the error message provided by the Web page, the main reason is that the configsections element must be the first child element of a configuration element. And my original configuration information is as follows ( wrong):

<Configuration><Connectionstrings><AddName="sqlConnectionString"connectionstring= "SERVER=192.168.0.199;DATABASE=TESTWEBDB; Uid=sa; pwd=123; " providername= "System.Data.SqlClient"/> </connectionstrings> <configsections> <section name= "Botdetect" requirePermission=< Span class= "hljs-string" > "false" type= " BotDetect.Configuration.BotDetectConfigurationSection, Botdetect "/> </configsections></CONFIGURATION>   

It is appropriate to place the configsections element in the first position under the configuration element:

<Configuration><Configsections><SectionName="Botdetect"requirepermission= "false" type= "BotDetect.Configuration.BotDetectConfigurationSection, Botdetect"/> </configsections> <connectionstrings> <add  Name= "sqlconnectionstring" connectionstring= providername= "System.Data.SqlClient"/> </connectionstrings></configuration>           

Related error messages and:

This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event log contains more information about the cause of this error.

Source: http://shiyousan.com/post/636347845422823189.

Only one <configSections> element is allowed. It must be the first child element of the root <configuration> element-HTTP Error 500.19

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.