Account model in MVC app doesn't work after deployment
I have an MVC app that I deployed to test on my machine (IIS on XP). I am unable to login using credentials I have set up using the ASP.NET configuration. Everything works fine before I published app. After typing in my username and password, t开发者_C百科he app doesn't seem to recognize it and gives the follwoing error message
![enter image description here][1]
By default, a new MVC project is configured to use the Membership Provider with SQLExpress using a file called aspnetdb.mdf in your App_Data folder. When you published, did that file make it to the destination?
To verify this is the issue, check your web.config. Look for the membership tag and the providers tag underneath that. Locate the AspNetSqlMembershipProvider provider and check its connection string. It will likely say ApplicationServices if you haven't changed it from the default. Then, check the ConnectionStrings node in your web.config to verify what database the Membership Provider is trying to use and where it's located.
精彩评论