I receive multiple (handled) ArgumentExceptions when I call
WindowsPrinciple.IsInRole. The exception text is:
A first chance exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Item has already been added.
Key in dictionary: "DOMAINNAME\userGroup"
Key being added: "DOMAINNAME\userGroup"
where DOMAIN is the domain of the group I am querying for, and userGroup
seems to be each group in the domain (which is large).
My code is as follows:
//this is called when the application first starts
AppDomain.CurrentDomain.SetPrincipalPolicy(Princip alPolicy.WindowsPrincipal);
public static bool UserIsInRole(string roleName)
{
WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;
return principal.IsInRole(roleName);
}
The exceptions are handled, as I am only notified when I turn on the break
on all exceptions IDE option. I am using framework 1.1.
This isn't a problem as such, I am just wondering if anyone else has
experienced this.
Thanks
Dan