0
votes

I'm new to asp.net MVC.

I'm using VWD Express 2012,ASP.NET MVC 4 Web Application template, Razor engine to develop my web application.

This is the problem I'm having:

After enable and created role(Administrator) and user account in Project -ASP.NET configuration. I couldn't log in with the account I just created. The error message is "The user name or password provided is incorrect." However in the tutorial, MvcMusicStore(http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7) I followed their steps and successfully created Administrator account. Therefore, I couldn't find out what caused that problem.

But the account I created by Ctrl + F5 - "Register" on the top left is able to log in.

Thanks for your time reading this post. Any hints or website links are appreciated.

1
Did you by any chance deploy your application to a server and then created the account on your local PC? - Kenneth
Does ASP.NET Development Server counts? Cuz I'm in the testing phase so I only use Ctrl+F5 to run the application and monitor the changes I made. I mean I only run it locally if that's what you were asking. - CounterSpell
No, if it's local you should be OK. The only thing I can imagine is that your ASP.NET configuration tool is writing the data to a different database then the one your application is reading from. Could you check your web.config and your application to make sure they both are targetting the same DB? - Kenneth
Sure, I'll do it right away, thanks for the hints:) - CounterSpell
BTW how many <connectionStrings> can I have in the web.config? Cuz I added one <connectionStrings> other than the defaultConnection. Can this be the cause of my problem? - CounterSpell

1 Answers

1
votes

After reading the comments, I can see what's happening.

Your MVC app is using the SimpleMembershipProvider. This provider is not compatible with the configuration tool. The config tool uses different tables and is thus not compatible.

You can do one of two things in this case: - don't use the configuration tool but use a script, or maybe create your own admin pages. - Disable simple membership so that MVC uses the old membership system

As for the database, you'll notice that after using the config tool, the tool creates a .MDF-file under the App_Data directory, that's where your user is stored that you created with the tool