'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'

 picture · Mar 17, 2009 · Viewed 8.8k times · Source

I want to use profiles and was able to use aspent_regsql -A p to install the tables. I can see them throughout SQL management studio.

I'm actually using SQLExpress 2005, and my dbo.aspnet_SchemaVersions is populated. Does anybody know what could be going wrong?

By the way, I'm pretty sure my connection string and app code are all right. Thanks in advance.

<system.web>
<membership>

  <providers>

    <remove name="AspNetSqlMembershipProvider" />

    <add name="AspNetSqlMembershipProvider"

      type="System.Web.Security.SqlMembershipProvider,

       System.Web, Version=2.0.0.0, Culture=neutral,                                

       PublicKeyToken=b03f5f7f11d50a3a"

      connectionStringName="RGConnectionString" />

  </providers>

</membership>
<profile>
  <providers>
    <add name="ProfileProvider" type="System.Web.Security.SqlProfileProvider,

       System.Web, Version=2.0.0.0, Culture=neutral,                                

       PublicKeyToken=b03f5f7f11d50a3a"

      connectionStringName="RGConnectionString"/>
  </providers>

Answer

 picture · Mar 17, 2009

Well, fool of me. I was quite sure it was a problem with SQLExpress database but it was actually my web.config file that was totally weird. I got it to work by adding the correct properties to the providers:

  <connectionStrings>
    <add name="RGConnectionString"
         connectionString="Data Source=(local)\SQLExpress;Initial Catalog=aspnetdb;Integrated Security=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>

    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add name="AspNetSqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="RGConnectionString" 
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="true"
             requiresUniqueEmail="true"
             passwordFormat="Clear"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="8"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression="" 
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <add name="ProfileProvider"
             type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="RGConnectionString"
             applicationName="/" />
      </providers>
    </profile>

  </system.web>