Configurazione dei Provider ASP.NET 4.0, 3.5 e 2.0 per SQL Server

<configuration>

  <connectionStrings>

    <!-- SQL Server Express -->
    <add name="SqlServerExpress"
      connectionString="data source=.\SQLEXPRESS;User Instance=true;
        AttachDBFilename=|DataDirectory|aspnetdb.mdf;
        Integrated Security=SSPI"
      providerName="System.Data.SqlClient" />
    
    <!-- SQL Server -->
    <add name="SqlServer"
      connectionString="Data Source=localhost;Initial Catalog=aspnetdb;
        User Id=AspNet;Password=a$pNetPa$$w0rd;"
      providerName="System.Data.SqlClient" />

  </connectionStrings>

  <system.web>

    <!-- Membership API -->
    <membership defaultProvider="SqlServerMembership">
      <providers>
        <add name="SqlServerMembership"
          type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="SqlServer"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="true"
          applicationName="/"
          requiresUniqueEmail="false"
          passwordFormat="Hashed"
          maxInvalidPasswordAttempts="5"
          minRequiredPasswordLength="7"
          minRequiredNonalphanumericCharacters="1"
          passwordAttemptWindow="10"
          passwordStrengthRegularExpression="" />
      </providers>
    </membership>

    <!-- Roles API -->
    <roleManager enabled="true" defaultProvider="SqlServerRoles">
      <providers>
        <add name="SqlServerRoles"
          connectionStringName="SqlServer"
          applicationName="/"
          type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </roleManager>

    <!-- Profile API -->
    <profile enabled="true" defaultProvider="SqlServerProfile">
      <providers>
        <add name="SqlServerProfile"
          connectionStringName="SqlServer"
          applicationName="/"
          type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </profile>

  </system.web>

</configuration>

Provider ASP.NET 2.0, 3.5 e 4.0

Seleziona la tua opzione per avere il web.config pronto per Membership, Roles e Profile API.