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

后端 未结 12 1624
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 09:26

I have a SQL Server 2008 DB with many tables filled with data and I used SQL Server Management Studio to generate a SQL dump by using the Script Wizard : Tasks -> Generate S

相关标签:
12条回答
  • 2020-12-08 09:57

    Old post, but I had an alternate solution.

    My connection strings in the web.config included Persist Security Info=True; in them. Removing this solved the error.

    0 讨论(0)
  • 2020-12-08 09:59

    I had a similar problem and I was able to solved it adding the default value to table aspnet_SchemaVersions. This default values were not added to the DB generated using Tasks -> Generate Scripts.

    Here a useful post

    INSERT INTO dbo.aspnet_SchemaVersions 
    VALUES
    ('common', 1, 1),
    ('membership', 1, 1),
    ('role manager', 1, 1);
    GO
    
    0 讨论(0)
  • 2020-12-08 10:03

    You may have to run aspnet_regsql.exe in order to get your schema values populated. You can hard-code the values as well as long as you have all of the generated objects (tables, views, sproc's, etc..

    The steps i took to resolve this which worked was:

    re-ran aspnet_regsql.exe ensured the default values where there restarted IIS.

    Then it worked..

    But if you just copy the database schema without the values, you need to run 'aspnet_regsql.exe' in order to populate the default values.

    the file can be found here (re: msdn): [drive:]\%windir%\Microsoft.NET\Framework\version (it's in 2.0 dir)

    and here's some info:
    http://msdn.microsoft.com/en-us/library/ms229862%28v=vs.80%29.aspx

    0 讨论(0)
  • 2020-12-08 10:04

    I am not at all a SQL or ASP.net guru or programmer, got the job by accident, but I had the same issue and the mistake was silly:

    In my Web.Conf the connection strings would usualy look something like this:

    <add name="AgriConnectionString" connectionString="Data Source=.\SQLEXPRESS; Initial Catalog=AgriBranch; pooling=true; Connection Timeout=120; Integrated Security=false;Persist Security Info=True; User ID=UserID; Password=PASS***WORD" providerName="System.Data.SqlClient" />
    

    Yet yesterday I accidently had my source looking like this "Data Source=./SQLEXPRESS".

    And I got the same error as discussed.

    This mistake would also explain why when taking the site offline and back online with Visual Studio's utility or when recompiling it would fix the error.

    0 讨论(0)
  • 2020-12-08 10:06

    Restarting the app pool worked for me

    0 讨论(0)
  • 2020-12-08 10:07

    I have found a very simple way, just paste this data in the aspnet_SchemaVersions table

    common              1   True
    health monitoring   1   True
    membership          1   True
    personalization     1   True
    profile             1   True
    role manager        1   True
    

    I had to use a few spaces to make the data aligned, ignore the blank spaces

    0 讨论(0)
提交回复
热议问题