1

I have made an asp.net MVC 4 Internet application. I wanted to have custom Create User function. So I used CreateUser function of MembershipProvider class and added <providers> configuration in my web.config.

But The problem is when I run the code it catches the exception Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Despite the database is generated by asp.net itself, it deosn't have any stored procedure (as previous versions had).

I can't use MVC 4's WebSecurity.CreateUserAndAccount function because it says it is not initialized.

So I don't know what to do. Any Help would be appreciated. Thanks.

Bardia
  • 393
  • 4
  • 11
  • You are setting up a "create new user" function? Does the rest of your membership work (ie, log in, use validation attributes)? – Mason240 Apr 10 '13 at 21:32
  • The asp.net's default login still works (Like it's default register). But I haven't implemented the login. Maybe after solving this login would be the next problem. – Bardia Apr 10 '13 at 21:39
  • Personally I would add a user to the DB manually and work on login before creating a new user. Are you building your own MembershipProvider or using the default one? – Mason240 Apr 10 '13 at 21:41
  • It is the default `MembershipProvider` and I didn't change anything. I am trying to implement a Login but I don't think that could be possible either, because it seems `MembershipProvider` uses stored procedure that my DB doesn't have any. – Bardia Apr 10 '13 at 21:55

1 Answers1

1

First of all, please use new ASP.NET Universal Providers.

I wanted to have custom Create User function

  • If you want to take care of user authentication and authentication by yourself, you need to implement Custom Membership Provider which basically overrides Default Membership Provider.

exception Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

  • you will not see that exception in new ASP.NET Universal Providers, because it doesn't use SchemaVersions table anymore.
Win
  • 61,100
  • 13
  • 102
  • 181