From 7e32fc0351abebb535b482515ac4e95503fb23f2 Mon Sep 17 00:00:00 2001 From: Chris Blyth Date: Wed, 2 Jan 2019 15:31:38 +0000 Subject: [PATCH] Revert "ExitCode cast fix #477" This reverts commit 7ac1cdc9f3f64b2a4da6550a752c254519be9234. --- src/Topshelf/Runtime/Windows/WindowsServiceHost.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Topshelf/Runtime/Windows/WindowsServiceHost.cs b/src/Topshelf/Runtime/Windows/WindowsServiceHost.cs index 670590dc..23fdb74f 100644 --- a/src/Topshelf/Runtime/Windows/WindowsServiceHost.cs +++ b/src/Topshelf/Runtime/Windows/WindowsServiceHost.cs @@ -77,12 +77,7 @@ public TopshelfExitCode Run() Run(this); - // this error code does not matter when running as a windows service - // the actual exit code is taken from the ServiceBase.ExitCode - // Windows service tooling already sees the service as stopped here - - // once ServiceBase.OnStop method exits, but the process is not yet finished here. - // even if we put Thread.Sleep(600000) the process will be killed after some timeout - return new TopshelfExitCode(ExitCode); + return (TopshelfExitCode) Enum.ToObject(typeof(TopshelfExitCode), ExitCode); } void HostControl.RequestAdditionalTime(TimeSpan timeRemaining)