title: EF - Code First approach: connection string and initializer are not being picked from app.config file
body: <p>I have a class library project where I have created entities, and context for Entity Framework. I have also created an initializer to seed default data in the database.</p>
  
  <p>Following is the app.config file of the class library project - </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" 
               type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
               requirePermission="false" /&gt;
    &lt;/configSections&gt;
    &lt;entityFramework&gt;
      &lt;contexts&gt;
        &lt;context type="WebExplore.Context.GeographyContext, WebExplore.Context"&gt;
          &lt;databaseInitializer type="WebExplore.Context.WebExploreInitializer, WebExplore.Context" /&gt;
        &lt;/context&gt;
      &lt;/contexts&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v11.0" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
    &lt;/entityFramework&gt;
    &lt;connectionStrings&gt;
      &lt;add name="WebExploreEntities"
          connectionString="Data Source=.\sqlexpress;Initial Catalog=WebExplore.Database;Integrated Security=true"
          providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>However, when I try to create a database using "Update-Database", it does create a database with a default name, and without seed data.</p>
  
  <p>I believe, somehow the app.config settings are not being picked when I try to create the database through "Update-Database" command. </p>
  
  <p>Can anyone please help me creating database and seed data by taking app.config settings into an account?</p>
  
  <p>Any help on this will be much appreciated.</p>