MVC 5 Not Auto Creating AspNetUser tables in DB

Are you using code first migrations?

normally, you have to enable migrations, create new migrations and apply them in order to create your db.

Go in package manager console and execute the following commands

enable-migrations
add-migration initial
update-database

EDIT

if you don't want to use migrations, you can also put this in the constructor of your context:

Database.SetInitializer<ApplicationDbContext>(new DropCreateDatabaseIfModelChanges<ApplicationDbContext>());

but you will lose your data everytime the db is re-created


Okay, I was doing something stupid. Basically trying to get the ApplicationDbContext to use a connection that was created by EF. Not the right way. To get the tables 'auto-magically` created. I needed to add a normal connection string to my Web.config connecting to the desired DB then set that in the IdentityModel.cs

Web.config

<connectionStrings>
  <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-MVC.WebSite-20150723075149.mdf;Initial Catalog=aspnet-MVC.WebSite-20150723075149;Integrated Security=True" providerName="System.Data.SqlClient" />
  <add name="MyConnection" connectionString="Data Source=devserver;initial catalog=MyCatalog;user id=user;password=pass;Integrated Security=True" providerName="System.Data.SqlClient" />
 </connectionStrings>

IdentityModel.cs

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
    public ApplicationDbContext()
        : base("MyConnection", throwIfV1Schema: false)
    {
    }

    public static ApplicationDbContext Create()
    {
        return new ApplicationDbContext();
    }
}

Hopefully, this helps someone. Thanks to all who helped.


 <add name="DefaultConnection" connectionString="Server=yourservername;Database=yourdbname;User Id=yourusername;Password=yourpassword;" providerName="System.Data.SqlClient" />

just make this connection string in web.config then run the application,than register a account. check now your database.