Annoying error with app.config file: “An unhandled exception of type ‘System.Configuration.ConfigurationErrorsException’ occurred in System.Configuration.dll - Configuration system failed to initialize”
Nov 28th, 2009 by ocvirek.com
I’m working on Windows Forms C# app and I come across this error when starting up application and trying to read some information from app.config file. After a lot o research I came a conclusion that this error is caused by generating a malformed config file (according to schema in c:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\DotNetConfig.xsd) by putting configSections after appSettings. Once I put the configSections element back to the top of the config file, everything worked as expected. Thanks to Dan for pointing this out on his blog: http://www.distribucon.com/blog/ConfigurationSystemFailedToInitialize.aspx.