Roles.AddUserToRole Cannot add a windows user

May 5, 2009 at 3:28 AM
I am using 3.5.4.1
Roles.AddUserToRole throws a NullReferenceExecption when I try to add a windows user to an existing role.

string roleName = "TestRole";
Roles.CreateRole(roleName);
string user = string.Format(@"{0}\{1}",Environment.UserDomainName, Environment.UserName);
Roles.AddUserToRole(user,roleName);

Adding a existing database user to a role does work.

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