4

I'm using ASP.NET MVC. I inserted ASP.NET membership tables into my database and i'm getting the error written below. Solution maybe? Thanks.

The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

Ante
  • 8,567
  • 17
  • 58
  • 70

4 Answers4

5
  1. Make sure the "aspnet_SchemaVersions" table exists in your database
  2. Make sure it contains an entry for each "feature" you are using. The aspnet scripts should do this for you.
  3. Check your security (connection string) to see if you have the right to select from that table, exec the procs, etc. from the web app.
GalacticCowboy
  • 11,663
  • 2
  • 41
  • 66
3

Did you run the aspnet_regsql.exe file?

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

I've done this countless times and never got that error. Try doing that.

EDIT:

alt text http://img529.imageshack.us/img529/9678/schema.png

Also take a look at this

Carlo
  • 25,602
  • 32
  • 128
  • 176
3

Thanks for the replies. These articles are very helpful. I figured out the problem though and it was a typical bonehead mistake. I used a script to recreate all the tables for Membership. I didn't copy any data into those tables. There is a table called aspnet_schemaversions. It requires some values to be able to validate the versions (duh). When I added these values into the table, it started working.

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

Ante
  • 8,567
  • 17
  • 58
  • 70
0

Old post, but I had a different solution:

In my connection strings in the web.config, I had Persist Security Info=True; included. Removing this solved my schema error,

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

Rob Scott
  • 7,921
  • 5
  • 38
  • 63