I have a method and want to run it with new thread with admin privilege,
[PrincipalPermission(SecurityAction.Demand, Role = @"BUILTIN\Administrators")]
void Install()
{
//do some thing
}
I run it in this way,
installerTh = new Thread(new ThreadStart(Install));
installerTh.Name = "Installer";
installerTh.Start();
but it gives me error
System.Security.SecurityException was unhandled
Message=Request for principal permission failed.
Any Idea to show UAC window before running this thread ? (or in the middle of running Process )