public ElevatedServiceClient() { _elevatedProcess = new Process(); _elevatedProcess.StartInfo.FileName = Path.Combine(Utils.GetApplicationPath(), Utils.GetExecutableName()); _elevatedProcess.StartInfo.Arguments = "--IPCServer"; _elevatedProcess.StartInfo.Verb = "runas"; _elevatedProcess.Start(); Thread.Sleep(1000); //Give IPCHandler time to load Interface = ChannelFactory<IElevatedOperationsInterface>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/myPipe/elevatedServices")); Interface.Heartbeat(); }
public ElevatedServiceClient() { _elevatedProcess = new Process(); _elevatedProcess.StartInfo.FileName = Path.Combine(Utils.GetApplicationPath(), Utils.GetExecutableName()); _elevatedProcess.StartInfo.Arguments = "--IPCServer"; _elevatedProcess.StartInfo.Verb = "runas"; _elevatedProcess.Start(); Thread.Sleep(1000); //Give IPCHandler time to load Interface = ChannelFactory <IElevatedOperationsInterface> .CreateChannel(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/myPipe/elevatedServices")); Interface.Heartbeat(); }