.net – ASP.net Membership – adding a role

asp.netasp.net-membershipnetroles

I need some advice whether it is recommended to add a membership role to a web application after the web application has been deployed and is in use.

The problem with this is that the role is created through the ASP.NET web site admin tool and automatically updates the ASPNETDB database.

The ASPNETDB database in the live environment will then have to be manually updated to reflect the updated roles. So as part of deployment while the website is offline I will need to update the security database with the extra role and add the database in again.

Is this the correct way to updates roles in a web application after it has been deployed?

Best Answer

I know this post is pretty old, but I think the easiest way to add a new role is to use the stored procedure as explained Here

EXEC aspnet_Roles_CreateRole 'ThisApplication', 'NewRole'