02 March 2008
"Configuration system failed to initialize" One Possible Solution
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>
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 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>
HTH,
Jon
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.