1

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>
demongolem
  • 9,474
  • 36
  • 90
  • 105
  • Check this link http://stackoverflow.com/questions/3292794/the-system-web-security-sqlmembershipprovider-requires-a-database-schema-compa – Pankil Agrawal Jan 09 '14 at 17:58

2 Answers2

5

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>
adripanico
  • 1,026
  • 14
  • 32
4

This may happen if you script your database and not populate [aspnet_SchemaVersions] table. This table holds information about membership table schema. If this table empty, you will see error about membership version.

Omer Cansizoglu
  • 1,271
  • 9
  • 14