You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ServiceRunner<CMailerService>.Run(config =>
{
config.Service(serviceConfig =>
{
serviceConfig.OnStop(service =>
{
//in here I want to restart the service if exitCode!=0
_serviceStoppedMail.SendServiceStoppedMail(ProjectConstants.RestartInfoMail, _lastError);
Log.Information("Service {0} is stopping...", name);
service.Stop();
Log.Information("Service {0} stopped", name);
});
});
});
The text was updated successfully, but these errors were encountered:
sekmenhuseyin
changed the title
Question: How to user ExitCode?
Question: How to use ExitCode?
Sep 16, 2019
I want to restart the service if service stopped with an error. I found that you have something called exit code: https://github.com/PeterKottas/DotNetCore.WindowsService/blob/4c0052bef2217c3f6b3ec15a98e23335fc07aa88/Source/PeterKottas.DotNetCore.WindowsService/ExitCode.cs
How can I user it in here:
The text was updated successfully, but these errors were encountered: