I have below scenario and i am not sure about 3rd point
- Sevice1 one is running
- it encounter some exception i need to stop the service1 and restart it again
- Can we do this stop and restart service1 by writing Restart code in Service1 itself
I have below scenario and i am not sure about 3rd point
Here is a ServiceController class article written on windows services; Ways of starting, stopping or restarting are explained. Or try this topic
You can also call the command below to do this
System.Diagnostics.Process.Start("net", "stop IISAdmin");
System.Diagnostics.Process.Start("net", "start IISAdmin");