Roles.AddUserToRole Throws NullReferenceException

May 5, 2009 at 2:02 AM
I am using 3.5.4.1
Calling Roles.AddUserToRole with a role that does not exist throws a NullReferenceException.

Sample Code:

string roleName = "TestRole";
if (Roles.RoleExists(roleName))
{
     Roles.DeleteRole(roleName);
}

Roles.AddUserToRole(userName,roleName);

Brian
Coordinator
May 5, 2009 at 6:09 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.