469,282 Members | 2,034 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

ArgumentException when call WindowsPrincipal.IsInRole

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
Nov 16 '05 #1
0 1172

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by JIM.H. | last post: by
1 post views Thread by Johan Johansson (Sweden) | last post: by
2 posts views Thread by chris | last post: by
6 posts views Thread by =?Utf-8?B?QkJN?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.