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