diff --git a/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs b/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs index c29ee9d..5f3d07f 100644 --- a/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs +++ b/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs @@ -198,6 +198,10 @@ public static int Run(Action> runAction) // Return the console host run result, so we get some idea what failed if result is not OK return (int)consoleHost.Run(); } + else + { + innerConfig.Service = innerConfig.ServiceFactory(innerConfig.ExtraArguments, null); + } ConfigureService(innerConfig);