Solution to "Configuration system failed to initialize"
1 min read
I got this error today: “Configuration system failed to initialize” while loading a config file. Looking at the web.config file it wasn’t obvious what the problem was.
<?xml version="1.0" encoding="utf-8" ?><configuration> <appSettings> <add key="PhotoDirectory" value="C:\_my\_dev\x\x\Photos\Members\"/> </appSettings> <configSections> </configSections> <connectionStrings> <add name="MicrosoftSocialConnectionString" connectionString="Data Source=(local);Initial Catalog=x;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings></configuration>
```text
I then remembered that I ran into a similiar problem before when I configSections wasn’t the firstChild of the configuration node. Moving appSettings under configSections solved this problem.
I know there are other solutions to this error message, but this one worked for me.
```xml
<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections> </configSections> <appSettings> <add key="PhotoDirectory" value="C:\_my\_dev\x\x\Photos\Members\"/> </appSettings> <connectionStrings> <add name="MicrosoftSocialConnectionString" connectionString="Data Source=(local);Initial Catalog=x;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings></configuration> Share:
Share on LinkedIn
Quick Share: Your custom post text has been copied to your clipboard! Click the button below to open LinkedIn's share dialog, then paste it.
💡 Tip: LinkedIn will open in a new tab. Use Ctrl+V (or Cmd+V on Mac) to paste your text.
Note: LinkedIn will show the article preview. You can add your custom text above it.