472,124 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,124 software developers and data experts.

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 1230

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.