title: Set DatabaseInitializerForType in config file for Custom Initializer to fire
body: <p>So I either get errors firing or nothing happens.  I know that I have custom Entity Framework Initializer like this:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data.Entity;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace EasyEntity
  {
      public class EasyInitializer : DropCreateDatabaseAlways&lt;EasyContext&gt;
      {
          protected override void Seed(EasyContext context)
          {
              List&lt;Person&gt; persons = new List&lt;Person&gt;
              {
                  new Person { FirstName = "Waz", LastName = "Amattau"},
                  new Person { FirstName = "Helena", LastName = "Handbasket"},
              };
  
              foreach (var person in persons)
                  context.Person.Add(person);
  
              base.Seed(context);
          }
      }
  }
  </code></pre>
  
  <p>I can call this when I set this quite easily:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data.Entity;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace EasyEntity
  {
      public class EasyContext : DbContext
      {
          public EasyContext() : base("name=EasyEntity")
          {
              Database.SetInitializer&lt;EasyContext&gt;(new EasyInitializer());   
          }
  
          public DbSet&lt;Person&gt; Person { get; set; }
      }
  }
  </code></pre>
  
  <p>Yet this is all in a class library and when I have a console app to test this it will not fire in the app.config.  I am ultimately looking to create builds or what not or apps to fire or not fire based on environment.  After scouring the internet it seems many different people label and put different text in this config setting.  I am using Entity Framework 6.1.3 according to NuGet, yet the config and references claim 6.0.0 and have wondered if this has changed and how to make it fire from a seperate project without having to hardcdoe the intializer to fire.  I have this:</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="DatabaseInitializerForType EasyEntity.EasyInitializer, EasyEntity" value="true" /&gt;
    &lt;/appSettings&gt;
  </code></pre>
  
  <p>I have tried setting 'value' to lots of things like 'Enabled', 'EasyEntity.EasyInitializer, EasyEntity', 'true', 'comeonpleasefire'.  But nothing appears to work as I am ignorant of what to do.  I saw another blog putting the setting inside the entityFramework node in the config section but that did not work either.  My total config setting in my console app for reference:</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;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
    &lt;/startup&gt;
    &lt;appSettings&gt;
      &lt;add key="DatabaseInitializerForType EasyEntity.EasyInitializer, EasyEntity" value="true" /&gt;
    &lt;/appSettings&gt;
    &lt;connectionStrings&gt;
      &lt;add name="EasyEntity" providerName="System.Data.SqlClient" connectionString="Server=.;Database=Easy;Integrated Security=True;"/&gt;
    &lt;/connectionStrings&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="Data Source=.; Integrated Security=True; MultipleActiveResultSets=True" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>