Windows service start error 1053 : The service did not respond to the start or control request in timely fashion while starting simple worker service template
See original GitHub issueDescribe the bug
Problem occurs after publishing and creating simple worker service template. Windows service gives Error 1053 : The service did not respond to the start or control request in timely fashion when starting service. Problem occurs only if publishing with target WinX86,WinX64 modes. Problem does no occur if publishing made using Portable mode. I have not tried with linux deamons
To Reproduce
Steps to reproduce the behavior:
- Using simple worker service template for .net core 3.0.0
- It also occurs after adding Microsoft.Extensions.Hosting.WindowsServices:3.0.0
- Publish using target mode either winx64 or winx86
- register service using sc create command. For instance sc.exe create WorkerService3 binPath=C:\Users\cahit.beyaz\source\repos\WorkerService1\WorkerService1\bin\Release\netcoreapp3.0\publish\WorkerService1.exe
Expected behavior
Windows service should start service normally for both targetruntime portable, x86,x64 when using simple Worker Service Template
Screenshots
Additional context
Add any other context about the problem here.
Include the output of dotnet --info
C:\Users\cahit.beyaz>dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26
Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support): Version: 3.0.0 Commit: 7d57652f33
.NET Core SDKs installed: 2.1.700 [C:\Program Files\dotnet\sdk] 2.1.801 [C:\Program Files\dotnet\sdk] 2.1.802 [C:\Program Files\dotnet\sdk] 2.2.202 [C:\Program Files\dotnet\sdk] 2.2.301 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@gerardo-lijs adding
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="3.0.0" />
packageand changing host builder as
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureLogging((hostingContext,config) => { config.AddLog4Net(); }) .UseWindowsService() .ConfigureServices((hostContext, services) => { services.AddHostedService<Worker>(); });
solves the issue. We can close the issue. I will after you verify.
@gerardo-lijs happy seeing things work