I'm trying to get authorization working on asp.net mvc4, so I try to use WebSecurity.
WebSecurity.InitializeDatabaseConnection("tradefairindia", "Users", "Id", "Username", false);
I've put this into Global.asax, and this is where the error comes, "Default Role Provider could not be found".
On the internet I read that I had to add this line of code to my web.config <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
. But I had it added already because of previous errors.
How can I resolve this problem??
Edit:
When I change it to defaultProvider="SimpleRoleProvider"
it gives me a new error. It says
The type or namespace name 'Data' does not exist in the namespace 'WebMatrix' (are you missing an assembly reference?)