6

Why do my users and roles end up in Users and Roles tables and not aspnet_users and aspnet_roles?


When I use the Aspnet web site administration tool (visualstudio->menu->project->aspnet configuration to add a user it ends up in the Users table; and new roles in the Roles table.

Everything I have read on the subject says aspnet_users and aspnnet_roles.

I am using aspnetmvc4 (beta), sqlserver2008r2, visualstudio2010. I have created the aspnet_xxx-tables in the database through aspnet_regsql.exe. I sniff sqlserver and get queries against Users and Roles. It even creates an Applications table.

As per request, the membership part of web.config:

<membership defaultProvider="DefaultMembershipProvider">
  <providers>
    <clear />
    <add connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
      enablePasswordReset="true" requiresQuestionAndAnswer="false"
      requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" 
      minRequiredPasswordLength="6"
      minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
      applicationName="/"
         name="DefaultMembershipProvider"
         type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </providers>
</membership>
2
  • Interesting! Could you add the <membership> section of your application's Web.Config to the question? Commented Oct 27, 2011 at 12:31
  • What database does "DefaultConnection" point to? aspnetdb? Commented Oct 28, 2011 at 18:05

1 Answer 1

8

Old school ASP.NET 2.0+ providers (System.Web.XXX.SqlXXXProvider)
--> Uses the aspnet_Users and aspnet_Roles tables, via stored procs.

The new Universal Providers (System.Web.Providers.XXX)
--> Uses the Users and Roles tables, via (EF-generated?) SQL.

More info here (from Mr Scott H): http://www.hanselman.com/blog/IntroducingSystemWebProvidersASPNETUniversalProvidersForSessionMembershipRolesAndUserProfileOnSQLCompactAndSQLAzure.aspx

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

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.