I am using the standard ASP.NET Webform template and its membership provider. Specifically I am using only the external id services (Google, Microsoft, Facebook, Twitter). All these worked fine, until I decided to point the database away from the default localdb to my own.
In web.config I changed the connectionStringName
attribute in <profile>, <membership> and <roleManager> from the default DefaultConnection
to my own connection string name. The following tables were then automatically created in my database: Users
, Roles
, Profiles
and Memberships
. However, it continued to use UsersOpenAuthAccounts
and UsersOpenAuthData
from localdb!
To find out who was using localdb, I deleted the connection string "DefaultConnection". The access was from OpenAuth.Login
. The error message was "Cannot attach the file d:\....\visual studio 2012\Projects\...\App_Data\DefaultConnection.mdf as database 'DefaultConnection'."
I am puzzled why this is happening. There is no DefaultConnection.mdf file in App_Data. There is only a aspnet-XXXX-yyyyMMddhhmmss.mdf.
Bottomline is: how do I make the membership provider use the two OpenAuth tables in my own database?
Thanks.