A quick note about setting up asp.net forms authentication on appharbor

The default mvc web app project in visual studio 2012 uses a default connection string named “DefaultConnection”. If like me, you follow the automatic migrations tutorial from appharbor and change the connection string name in the web.config AND you plan on using forms authentication, make sure to also update it in the InitializeSimpleMembershipAttribute class:


WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);

and AccountModels.cs in the models folder:

public UsersContext()
 : base("DefaultConnection")

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s