title: How to load EF connection string from App.config after made it?
body: <p>I have problem and can't find solution. <br />
  On start I have that <code>App.config</code> file:</p>
  
  <pre><code>...
  &lt;connectionStrings&gt;
      &lt;add name="IdealsadEntities" connectionString="" providerName="System.Data.EntityClient" /&gt;
  &lt;/connectionStrings&gt;
  ...
  </code></pre>
  
  <p>In my application (<strong>WinForm</strong>) I read params for connection to database from <strong>xml</strong> file and then override App.config and got compiled file <code>AppName.exe.config</code>.</p>
  
  <p>Problem is with creating <strong>instance</strong> of my <strong>entities</strong>. I used this code after creating file:</p>
  
  <pre><code>IdealsadEntities _db = new IdealsadEntities();
  </code></pre>
  
  <p>But in first run application <code>_db.Database.Connection</code> is <strong>null</strong>. In second run it reading from <code>AppName.exe.config</code> file and works fine.</p>
  
  <h2>Questions:</h2>
  
  <ul>
  <li>So my question is why first runing read empty string even if I
  rewrite this file?</li>
  <li>Is DbContext execute earlier?</li>
  <li>How to fix it, to get new connection string from rewrited file?</li>
  </ul>