5

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

2
  • Update I reloaded the solution and i am able to see aspnetdb.mdf now, however, the website administration tool still shows no users. Commented Sep 13, 2012 at 21:10
  • This is a bit old but for anybody new that is looking for the localdb it is not stored in the project anymore but in the users local files. Commented Mar 6, 2015 at 12:56

5 Answers 5

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

see this post 'WSAT is built to work with ASP.NET Membership, and is not compatible with Simple Membership. There are two main options there: Use the WebSecurity and OAuthWebSecurity API to manage the users and roles Create a web admin using the above APIs Since SimpleMembership runs on top of your database, you can update your users as you would any other data - via EF or even in direct database edits'
1

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.

Comments

0

MVC 4 doesn't support the usage of Website Administration Tool as it uses WebMatrix's simple membership.

This is suggested in this article

Comments

0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.