title: ASP.NET Identity DbContext Issue with EF Code First Migrations
body: <p>EDIT2:
  I used this "Data Source=(LocalDB)\MSSQLLocalDB" for the connection string, and everything worked as expected. I guess i'm doing something stupid with sqlexpress.</p>
  
  <hr>
  
  <p>I'm trying to create a simple database for users, using ASP.NET(4.5) Identity(2.2) and EF(6) Code First migrations, based on <a href="http://bitoftech.net/2015/01/21/asp-net-identity-2-with-asp-net-web-api-2-accounts-management/" rel="nofollow noreferrer">this tutorial</a></p>
  
  <p>The problem  only happens when ApplicationDbContext inherits from IdentityDbContext. </p>
  
  <p>So,first, i create an empty asp.net project. 
  Then the Entity class for the users:</p>
  
  <pre><code>using Microsoft.AspNet.Identity.EntityFramework;
  using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.Linq;
  using System.Web;
  
  namespace AspNetIdentity.Infrastructure
  {
    public class ApplicationUser : IdentityUser
    {
      [Required]
      [MaxLength(100)]
      public string FirstName { get; set; }
  
      [Required]
      [MaxLength(100)]
      public string LastName { get; set; }
  
      [Required]
      public byte Level { get; set; }
  
      [Required]
      public DateTime JoinDate { get; set; }
  
    }
  }
  </code></pre>
  
  <p>Then i create the DbContext class:</p>
  
  <pre><code>   public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
      public ApplicationDbContext()
          : base("DefaultConnection")
      {
  
      }
  
      public static ApplicationDbContext Create()
      {
          return new ApplicationDbContext();
      }
  
  }
  </code></pre>
  
  <p>So far so good. Now here is the issue:
  I add the connection string in the web.config as shown below</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="DefaultConnection" connectionString="Data      
    Source=.\sqlexpress;Initial Catalog=AspNetIdentity;Integrated    
    Security=SSPI;" providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>and when i run </p>
  
  <pre><code>enable-migrations
  </code></pre>
  
  <p>i get the following error:</p>
  
  <p><strong>An error occurred accessing the database. This usually means that the      connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See <a href="http://go.microsoft.com/fwlink/?LinkId=386386" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=386386</a> for information on DbContext and connections. See the inner exception for details of the failure.</strong></p>
  
  <p>If i try the exact same things, but with normal DbContext everything goes as expected. Any ideas what I might be doing wrong? This thing is bugging me for days now.</p>
  
  <hr>
  
  <p>EDIT1:
  Below is the full output in the console, which is huge so im attaching them as images, i hope thats ok.</p>
  
  <p><a href="https://i.stack.imgur.com/wKbPP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wKbPP.jpg" alt="output_first_part"></a>
  <a href="https://i.stack.imgur.com/cgzcS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cgzcS.jpg" alt="output_second_part"></a></p>
  
  <p>If the error is too obvious in there, i'm sorry, but im a newbie :)</p>