I recently updated an MVC 4 site using simple membership to MVC 5. I then have a line in a controller that uses the membership provider:
SimpleMembershipProvider provider = new SimpleMembershipProvider();
if (provider.GetUserId(User.Identity.Name) == id)
However on that controller I get the message:
You must call the "WebSecurity.InitializeDatabaseConnection" method before you call any other method of the "WebSecurity" class. This call should be placed in an _AppStart.cshtml file in the root of your site.
So I googled it and applied the stackoverflow suggestion in this link to global.asax. That didnt work so I applied it to the AuthConfig in App_start folder. That also doesnt work.
Has anyone found how to get this working in MVC 5? Your help is much appreciated.