aspnetdb 没有填充角色?

aspnetdb is not getting populated with roles?

我在一个 sqlserver 实例上维护了 aspnetdb.mdf,我在我的 ASP.net 网站应用程序中使用它来获取角色和成员资格。 问题是,当我使用 ASP.net 网站配置工具添加角色时,这些角色没有填充到我的 aspnet_Roles table in aspnetdb.

另一方面,用户和应用程序设置分别很好地插入 tables aspnet_Users 和 aspnet_Applications table? 我知道我的 web.config 文件有问题但不知道是什么?

web.config

<configuration>
  <appSettings>
      <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
    </appSettings>

  <connectionStrings>
    <add name="SqlSequrityConnectionString"
         connectionString="Data Source=NASEER\SQLEXPRESS;Initial Catalog=aspnetdb;Integrated Security=True"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <authorization>
      <allow users="56013" />
    </authorization>

    <authentication mode="Forms" />
    <roleManager enabled="true" />
    <compilation debug="true" targetFramework="4.5.1" />
    <httpRuntime targetFramework="4.5.1" />

    <membership defaultProvider="SecurityTutorialsSqlMembershipProvider">
      <providers>
        <!-- Add a customized SqlMembershipProvider -->
        <clear/>
        <add name="SecurityTutorialsSqlMembershipProvider"
        type="System.Web.Security.SqlMembershipProvider"
        connectionStringName="SqlSequrityConnectionString"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        applicationName="SecurityTutorials"
        requiresUniqueEmail="true"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="5"
        minRequiredPasswordLength="7"
        minRequiredNonalphanumericCharacters="1"
        passwordAttemptWindow="10"
        passwordStrengthRegularExpression=""/>
      </providers>
    </membership>
  </system.web>

</configuration>

通过添加以下代码我让它工作了......!

<roleManager enabled="true" defaultProvider="SqlRoleManager">
      <providers>
        <add name="SqlRoleManager"
             type="System.Web.Security.SqlRoleProvider"
             connectionStringName="SqlSequrityConnectionString"
             applicationName="MyApplication" />
      </providers>
    </roleManager>