I need to restart IIS from a C#/.NET application. This seems like a trivial issue, but I haven\'t had success thus far, and none of the answers from this question have worke
string serviceName = "W3SVC"; //W3SVC refers to IIS service
ServiceController service = new ServiceController(serviceName);
service.Start();
service.WaitForStatus(ServiceControllerStatus.Running);// Wait till the service started and is running