How can I restart a windows service programmatically in .NET? Also, I need to do an operation when the service restart is completed.
How about
var theController = new System.ServiceProcess.ServiceController("IISAdmin"); theController.Stop(); theController.Start();
Don't forget to add the System.ServiceProcess.dll to your project for this to work.