PC Review


Reply
Thread Tools Rate Thread

ArgumentException when call WindowsPrincipal.IsInRole

 
 
=?Utf-8?B?RGFuIEtlbGxleQ==?=
Guest
Posts: n/a
 
      7th Jan 2005
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(PrincipalPolicy.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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WindowsPrincipal.IsInRole actually check roles and NOT groups? Andy Microsoft C# .NET 1 16th May 2008 10:59 PM
WindowsPrincipal.IsInRole fails when there is Whitespace in role n F5F5F5 Microsoft C# .NET 1 7th Jan 2008 01:45 PM
Case Sensitivity Issue with WindowsPrincipal.IsInRole (.net 1.1) =?Utf-8?B?Sm9obiBSdXNr?= Microsoft Dot NET Framework 2 17th Jun 2004 05:48 AM
WindowsPrincipal.IsInRole is very slow over dial-up Alek Davis Microsoft C# .NET 0 14th Feb 2004 10:51 PM
WindowsPrincipal and WindowsIdentity. Kevin Burton Microsoft ASP .NET 3 8th Jan 2004 04:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:23 PM.