title: 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll, System.Configure already included
body: <p>I have a Windows Form application in VS 2013 and I'm trying to establish a database connection. Every time I run the program, however, I receive the following error: </p>
  
  <pre><code>An unhandled exception of 'System.Configuration.ConfigurationErrorsException' occurred in         
  System.Configuration.dll
  
  Additional information: Configuration system failed to initialize
  </code></pre>
  
  <p>Here's what my files look like:</p>
  
  <h2>    Program.cs</h2>
  
  <pre><code>using System;
  using System.Collections;
  ....
  
  namespace ProgramName
  {
      static class FakeNameB
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          [STAThread]
          static void Main()
          {
              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);
              Application.Run(new Form1());
          }
      }
  }
  </code></pre>
  
  <h2>Form1.cs</h2>
  
  <pre><code>using System;
  ....
  
  namespace ProgramName
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              string CS = System.Configuration.ConfigurationManager.ConnectionStrings[&lt;nameInApp.config&gt;].ConnectionString.ToString();
  
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <h2>    App.config</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt;
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
      &lt;/startup&gt;
      &lt;configSections&gt;
          &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" &gt;
              &lt;section name="ProgramName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
          &lt;/sectionGroup&gt;
      &lt;/configSections&gt; 
      &lt;configurationStrings&gt;
          &lt;add name = &lt;name&gt; connectionString = "Data Source=&lt;dataSource&gt;;Initial Catalog=&lt;catalog&gt;;Integrated Security=True;" providerName="System.Data.SqlClient"&gt;&lt;/add&gt; 
      &lt;/configurationStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>None of the suggestions in <a href="https://stackoverflow.com/questions/6436157/configuration-system-failed-to-initialize">this post</a> seemed to help, and I was not able to reference System.Configuration.dll like <a href="https://stackoverflow.com/questions/6536715/get-connection-string-from-app-config">this post</a> suggested. Any ideas? </p>