Reputation: 1683
few days ago, my freind asked me to build him a proagram that start and stop process.
so, as easy as it is. i did the next code:
(using System.Diagnostics)
Process process;
process = Process.start("SOMEONE.exe");
Process.Kill();
Now, thats it the easy part. everything works. but. when i do the same code in asp.net, its strat the process, but when you kill the process, nothing happnd. no matter what i did, any one have any solion to the next problem :(?
Upvotes: 0
Views: 486
Reputation: 3401
AppPool in IIS needs to run under LOCAL Account - otherwise ASP.NET doesn't have enough rights to start/stop processes on the server.
Upvotes: 0
Reputation: 17508
From MSDN:
The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.
Upvotes: 2