Reputation: 532
I just installed MVC 4 and made a default internet project. I was able to create a username/login/change password.
In MVC 3, after creating a user, I would see an ASPNETDB.MDF file in the App_Data folder, and I would also be able to manage users/roles in the Website Administration Tool.
with MVC 4, I do not see an ASPNETDB.MDF file, even if i click show all files. Also, any new users created are not shown in the Website Administration Tool.
Is there anywhere else I can look to retrieve users / set rolls ?
Thanks
Upvotes: 5
Views: 4092
Reputation: 1
Open the web.config file in your solution to check where and by what name the mdf file is created.
You should be able find your db details over here in the config file:
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source= ******>
With that, you can open the respective database on SQL server, to check the details you were looking for
Upvotes: 0
Reputation: 17540
The membership provider in MVC 4 Internet applications, referred to as SimpleMembership, does not use the database ASPNETDB.MDF. You should find another database in the App_Data directory that is named using the convention aspnet-project name-999999999999.mdf, where "project name" is the name of the VS project it is created in and the number I believe uses date/time and maybe some other digits to make a somewhat unique id. You will find the user data in this database and it is not compatible with the website administration tool. You can find out more about the SimpleMembership database and customizing it in this post.
Upvotes: 0
Reputation: 121
MVC 4 doesn't support the usage of Website Administration Tool as it uses WebMatrix's simple membership.
This is suggested in this article
Upvotes: 0
Reputation: 11
As far as I know, You have to Refresh your solution, Show All files and then look in the map App_Data. Perhaps you forgot to refresh?
Also you can manually go to your .MDF file then drag it into Visual Studio. Then it will automatically open The server explorer where you can see the new users.
Upvotes: 1
Reputation: 190
I'm not sure whether you could use "Website Administration Tool" with MVC4
Go to the Models
folder and open AccountModeles.cs
class.
You will find the code,
public UsersContext()
: base("DefaultConnection")
{
}
Go to the web.config file
See the connection string with the name DefaultConnection
,You can see the database where the User/Roles are stored in.
Upvotes: 2