Deleting users

Jul 14, 2008 at 3:46 PM
Hi,
We're running BlogEngine.NET 1.3.0.0 and having a problem when trying to delete a user. We get the following error message:

 

The array parameter 'roleNames' should not be empty.
Parameter name: roleNames
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The array parameter 'roleNames' should not be empty.
Parameter name: roleNames

Source Error:

Line 75: Membership.DeleteUser(username);
Line 76: string[] roles = Roles.GetRolesForUser(username);
Line 77: Roles.RemoveUserFromRoles(username, roles);
Line 78: Response.Redirect(Request.RawUrl);
Line 79: }

Thanks for any insight.

 

Coordinator
Jul 14, 2008 at 4:55 PM
This issue was fixed in 1.4. It occurs when no roles have been applied to a given user.
Jul 14, 2008 at 5:04 PM
I am seeing a similar issue when trying to delete users with 1.4  w/ SQL Server:

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: The user 'test' was not found.


Source Error:
Line 111:
Line 112: if (roles.Length > 0)
Line 113: Roles.RemoveUserFromRoles(username, roles);
Line 114:
Line 115: if (HttpContext.Current.User.Identity.Name.Equals(username, StringComparison.OrdinalIgnoreCase))

Jul 21, 2009 at 8:50 PM
Edited Jul 21, 2009 at 8:51 PM

Hello,

         I am using BlogEngine 1.5 and getting the same error as sjohnson has posted above. I have supplied roles to the user being deleted.

The user 'test' was not found.

Server Error in '/FISWeb2.0/Blog' Application.

 


The user 'test' was not found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: The user 'test' was not found.

Source Error:

Line 111:
Line 112:		if (roles.Length > 0)
Line 113:			Roles.RemoveUserFromRoles(username, roles);
Line 114:            
Line 115:        

 

Thanks,