Last post Oct 13, 2014 04:31 AM by Michelle Ge - MSFT
Oct 10, 2014 12:40 PM|Davidp0000|LINK
I am attempting to set up the role provider for MVC 5 but I can not get any calls on the Roles object to work. I receive the exception "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion". The RoleManager object and User.IsInRole calls
work just fine but I have no luck with the Roles object.
I have added these settings to the web.config
<add name="SqlRoleManagerConnection" connectionString="Data Source= (LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\Techdb3.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
Oct 11, 2014 01:57 PM|Davidp0000|LINK
PLEASE HELP: I am very close. I found that the <provider> tag breaks the provider. If I remove it the Roles object works but the role database is then created in a random database file. I'm guessing that the role tables and scripts are just not being created
when I add it to my default connection.........I can't be the only one that has had this problem.
Oct 13, 2014 04:31 AM|Michelle Ge - MSFT|LINK
According to your description and the code you provided, I think the roleManager has no error, so I think you need to make sure the connectionString is correct, then we can correct connect the DataBase. Then in the prociders, you need make sure the connectionStringName
and applicationname are all correct.
There is an artivle about RoleManager, please refer to the link below:
Hope it's useful for you.