diff --git a/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs b/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs index 70071cd..f0c6080 100644 --- a/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs +++ b/Source/PeterKottas.DotNetCore.WindowsService/ServiceRunner.cs @@ -213,7 +213,7 @@ private static string GetServiceCommand(List extraArguments) PlatformServices.Default.Application.ApplicationName + ".dll"); host = string.Format("{0} \"{1}\"", host, appPath); } - if (!host.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)) + else { //For self-contained apps, skip the dll path extraArguments = extraArguments.Skip(1).ToList();