C# Disciples

my life in Avalon ….

Problem: Configuration system failed to initialize

I got this error today and I was shocked… The InnerException was saying something like this

Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element.

 

Well I had ONLY 1 configSections element in my App.config…. After loads of hair pulling I discovered its because the <configSections> element has to be defined as the first element in the App.config. Well thanks for the very useful exception message!

I hope this helps whoever encounters the same error…

Advertisement

February 25, 2010 - Posted by | WPF

10 Comments »

  1. …must be the first child of the root element…

    I would have thought that was self explanatory, no?

    Comment by Geoist | February 26, 2010 | Reply

  2. It says exactly what the problem is. Come on Marlon. :-(

    Comment by sacha | February 27, 2010 | Reply

  3. Your comment seems to be sarcastic with regard to the usefulness of the exception message, but it tells you exactly what you need to know, does it not?

    Comment by Mike Vargas | March 5, 2010 | Reply

  4. Hi, It’sAccounting Essay help me! Good luck!

    Comment by Accounting Essay Help | March 12, 2010 | Reply

  5. Hi, it’s cool!!

    Comment by Essay examples | March 12, 2010 | Reply

  6. Can someone state where this app.config is? I don’t have one :) or :(

    I am dealing w/ Silverlight not WPF and I get this ridiculous error right after installing VS2010 (“final”) and SL4 tools for VS2010, for each of the app.xaml, page.xaml??

    Thanks!

    Comment by Marie | April 22, 2010 | Reply

    • You have to create an app.config for your application / service. Right click in your solution tree > Add > New Item > Application Configuration File.

      Also, search MSDN

      Comment by Geoist | May 3, 2010 | Reply

  7. you are a genius . Ur post was a miracle cure

    Comment by Anandarajeshwaran.J | July 20, 2010 | Reply

  8. I don’t HAVE an app.config or web.config file for this application! Never did! It always worked before.

    Comment by Jim Zethmayr | December 18, 2010 | Reply

  9. Hi man,

    Thanks for you post. I was trying to solve it for about 2 days and thanks your post I could resolve that. I just gave it a shot and it worked fine!!!

    Saudações do Brazil!

    All the best!!!

    Comment by Evandro | January 18, 2012 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 730 other followers