PeterKottas / DotNetCore.WindowsService

Simple library that allows one to host dot net core application as windows services. Perfect solution to power micro-services architecture.
MIT License
568 stars 150 forks source link

When starting the service, then immediately stopped too #108

Open drano opened 6 years ago

drano commented 6 years ago

.NET Core: 2.1 PeterKottas.DotNetCore.WindowsService: 2.0.9

When I start my window service as command line, I have this message:

Starting up as a console service host
Service MyTestService started
I started
E:\dev\serviceWindowsNetCore\bin\Release\netcoreapp2.0\win-x64\log.txt
The MyTestService service is now running, press Control+C to exit.
Stopping the MyTestService service
Service MyTestService stopped
I stopped
The MyTestService service has stopped.
Control+C detected, attempting to stop service.
Service MyTestService stopped
I stopped
The MyTestService service has stopped.

Why service is stopped before call control+C ? After installing as a window service, starting has an error message: "The My Test Service service on Local Computer started and then stopped."