Author: Garrydias | Posted on: 6/24/2008 11:42:42 AM | Views : 276

this is my code 
 
Dim str() As String

Dim role As System.Web.Security.RolePrincipal  
Dim countUserRoles As Integer                

role = CType(User, System.Web.Security.RolePrincipal) 

str = role.GetRoles()     

 
 the line role = CType(User, System.Web.Security.RolePrincipal)  ever throws an exception :
Unable to cast object of type 'System.Security.Principal.GenericPrincipal' to
type 'System.Web.Security.RolePrincipal'.
 
In my local enviroment it works fine but on server this error always happens 
 
...

Go to the complete details ...