What's the right process to use ASP.NET Web Site Administration Tool? I want to use this tool to configure roles and membership.
Steps that I tried:
- Create MVC web application.
- Run aspnet_regsql to create related database. The command tool is suggested by error messaage below. Although I realize the Role, Membership table has been created since project creation.
Modify web.config of new webapplication:
<system.web> <roleManager enabled="true" defaultProvider="simple"> <providers> <clear/> <add name="simple" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"/> </providers> </roleManager> <membership defaultProvider="simple"> <providers> <clear/> <add name="simple" type="WebMatrix.WebData.SimpleMembershipProvider,WebMatrix.WebData"/> </providers> </membership> ... ... <add name="DefaultConnection" connectionString="Data Source=(localdb)\.\IIS_DB;InitialCatalog=aspnet-DemoWebApplication-20130625124639;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnet-DemoWebApplication-20130625124639.mdf" providerName="System.Data.SqlClient" />
Error message seen on the tool page: There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: You must call the "WebSecurity.InitializeDatabaseConnection" method before you call any other method of the "WebSecurity" class. This call should be placed in an _AppStart.cshtml file in the root of your site.
Can you help? Please let me know if you need more information.
I've investigate this issue for hours, found below helpful threads, but still does not fix it completely:
- Web Site Administration Tool ERRORS
- Web Site Administration Tool Not Working with ASP.NET MVC