I came across some code that was said to have a similar issue, and the
cure was documented in the code as making sure the AppDomain had been
set up with one:
AppDomain myDomain = System.Threading.Thread.GetDomain();
myDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal wp =
(WindowsPrincipal)System.Threading.Thread.CurrentPrincipal;
After adding SetPrincipalPolicy this worked fine (calling wp.IsInRole
(WindowsBuiltInRole.Administrator); )
MSDN examples show similar code. It might be obvious to all that this is
the way the code should look, but I don't know much about this area and
it's not obvious to me. Maybe your code already looks like that.
Phil Wilson
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Pardee, Roy
Sent: Friday, June 02, 2006 3:13 PM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] WindowsPrincipal.IsInRole() never returns
Hmm... Well, it does belong to a domain. But I'm afraid to take it
out, as I don't know if I have perms enough to rejoin the domain later.
And I'm working from home today, so it wouldn't be convenient to get
tech support...
BTW--in case it matters--I see the same behavior whether or not my VPN
connection is active. And the call I'm making is specifically:
WindowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator)
Thanks!
-Roy
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Saad Rehmani
Sent: Thursday, June 01, 2006 5:00 PM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] WindowsPrincipal.IsInRole() never returns
Does the machine you're running this on belong to a domain?
If so, can you remove it and see if its still taking that long?
Just a thought,
-s
--
Saad Rehmani / Prodika / Dallas / TX / USA
-----Original Message-----
From: "Pardee, Roy" <[EMAIL PROTECTED]>
Date: Fri, 2 Jun 2006 15:03:42
To:[email protected]
Subject: [ADVANCED-DOTNET] WindowsPrincipal.IsInRole() never returns
Hey All,
Can anybody think of a reason why my computer would go zombie when my
asp.net 1.1 app makes a call to WindowsPrincipal.IsInRole()? I don't
even know how to debug this. I've waited > 5 minutes for the call to
return & nothing, zip, zilch. Can anybody throw me a clue?
Thanks!
-Roy
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com