|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WindowsIdentity._GetCurrentToken() Access is deniedWindowsIdentity._GetCurrentToken() method. Reflector shows the _GetCurrentToken() method as [MethodImpl(MethodImplOptions.InternalCall)] private static extern IntPtr _GetCurrentToken(); which i believe means it is an internal call into the CLR.Does anyone have any thoughts on why this would be happening? The call stack is ExceptionType="System.ApplicationException" Message="Access is denied." TargetSite="IntPtr _GetCurrentToken()" Source="mscorlib" at System.Security.Principal.WindowsIdentity._GetCurrentToken() at System.Security.Principal.WindowsIdentity.GetCurrent() at System.AppDomain.GetThreadPrincipal() at System.Threading.Thread.get_CurrentPrincipal() at my code..... my code is: AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); //exception happens here string user = System.Threading.Thread.CurrentPrincipal.Identity.Name; |
|||||||||||||||||||||||