Friday, July 1, 2011

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.

When you first deploy your asp.net application to shared server, you could face this error if your application used membership authentication. I have been looking around in the internet for solutions but all of them are not working for me. I tried myself to solve it and fortunately, i did it perfectly. Here is my tried:
1- Make sure when you create database, you remember to add values to aspnet_schemaversions table:
common 1 1
health monitoring 1 1
membership 1 1
personalization 1 1
profile 1 1
role manager 1 1

2-
Remmeber to put applicationName="APPNAME" which APPNAME is the name value in table aspnet_applications in , and in web.config
3- If 2 solutions above don't work, Add slash ("/") before APPNAME both in applicationName and in aspnet_applications.
for example: applicationName="/APPNAME" and in aspnet_application: /APPNAME

good luck and have fun with this error!