I'm following along with http://msdn.microsoft.com/en-us/library/bb332338.aspx to host my service as a Windows service. It installs just fine, but I would like to actually set the recovery options to "Restart the Service" on a "First failure", "Second failure", or "Subsequent failure". How can this be achieved?
Along with my hosted Windows service's installer, is it possible to set the recovery options when errors occur?
1.6k views Asked by Alexandru At
2
The options for doing so are not simple, they require invoking some methods to pull it off. You could use something like the following extension, http://www.codeproject.com/Articles/6164/A-ServiceInstaller-Extension-That-Enables-Recovery or rolling your own using the commands.
See http://netcode.ru/dotnet/?lang=&katID=30&skatID=277&artID=7660 for more information