This project is read-only.

Part 7 - Role-based Authorization - Log Page Problem

Oct 14, 2011 at 8:13 PM


When I added


above the StoreManager class, entering the URL http://localhost:50575/StoreManager results in a resource cannot be found error.  Remove the Authorize attribute and the same URL works although of course without the Log On page being displayed.

I used NGet to install ASP.NET Universal Providers and then edited the configuration file so that the database used was MvcMusicStore.sdf. This allowed me to run the ASP.NET Configuration website and created a role and user (which are present in the database).

Is there anything else I need to do in order to get the log on page to appear.



Oct 18, 2011 at 2:13 AM

Same problem here, dude.

Don't know what to do about it.

So frustrating !@#!@$%

Oct 24, 2011 at 11:16 PM

Do you have SQL Server Express installed? Can you check the completed project that's included with the download and see if it runs?

Oct 25, 2011 at 10:47 PM

Did not have SQL Server Express installed.  Installed it and then tried the completed project in the download, which ran successfully. Thanks for the advice

Oct 25, 2011 at 11:50 PM

Glad it's working for you. The built-in ASP.NET Membership system uses SQL Server Express. If you want to set up ASP.NET Membership using the Universal Providers, Scott Hanselman has a detailed walkthrough that shows how to set it up:

I haven't tried that with MVC Music Store yet, though.

Nov 4, 2011 at 9:11 PM

Just tried using the Universal Providers as per the instructions on Scott Hanselman blog and got the ASP.NET Membership system to used SQL Server Compact. The NUGET package installation does almost all the work for you, just need to copy the example SQL Server Compact connection string from the blog post, change the connection string name to match that in the NUGET add configuration, and finally change the requiresQuestionAndAnswer setting to true in order to get the security question.