title: Code first still trying to create database
body: <p>I get always this exception, even if Database initializer is set to CreateIfNotExists.</p>
  
  <pre><code>Additional information: Cannot create file 'C:\\Users\\Krab\\Documents\\Visual Studio 2013\\Projects\\Customer_UI\\customers2.mdf' because it already exists. Change the file path or the file name, and retry the operation.
  
  CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
  </code></pre>
  
  <p>Why is EF trying to create the database even if it already exists?</p>
  
  <p><strong>App.config</strong></p>
  
  <pre><code> &lt;connectionStrings&gt;
      &lt;add name="Customer.CustomersContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename='C:\\Users\\Krab\\Documents\\Visual Studio 2013\\Projects\\Customer_UI\\customers2.mdf';Integrated Security=True;Connect Timeout=30" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p><strong>DbContext:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Data.Entity;
  
  namespace Customer
  {
      public class CustomersContext : DbContext
      {
          public CustomersContext() : base("Customer.CustomersContext")
          {
              Database.SetInitializer(new CreateDatabaseIfNotExists&lt;CustomersContext&gt;());
              //Database.CreateIfNotExists();
              //System.Console.WriteLine(Database.Connection.ConnectionString);
          }
  
          public DbSet&lt;CustomerDb&gt; Customers { get; set; }
          public DbSet&lt;Contact&gt; Contacts { get; set; }
      }
  }
  </code></pre>