DotNetCore.WindowsService
DotNetCore.WindowsService copied to clipboard
Simple library that allows one to host dot net core application as windows services. Perfect solution to power micro-services architecture.
private static void StopService(HostConfiguration config, ServiceController sc) { if (!(sc.Status == ServiceControllerStatus.Stopped | sc.Status == ServiceControllerStatus.StopPending)) { sc.Stop(); sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(1000)); Console.WriteLine($@"Successfully stopped service ""{config.Name}"" (""{config.Description}"")"); config.OnServiceStop?.Invoke(config.Service); } else { Console.WriteLine($@"Service...
How can I change/remove default messages shown when starting project as a console app? For example I am seeing messages: 1) Starting up as a console service host 2) The...
When running my service with the `action:install` parameter, it outputs the following message to the console: ``` Successfully registered and started service "{my service name}" ("{my service description}") ``` This...
I was wondering what the standard approach would be to handle service recovery in case of failures. If the service suddenly fails where would I put logic to start it...
Allow onException timer handler to catch exceptions thrown in async methods Developing my service I came across problem which took me a while to debug. The problem is that when...
Hi, I want to have two this same services but with different names. How I can do that. Overriding name and display-name with CMD doesn't work (they are ignored...) 
.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...
I am working in VS 2017, and I create a new console app in .Net Core 2.1. I use the nuget package manager to add PeterKottas.DotNetCore.WindowsService to my dependencies. Then...
Service
Good day, I have installed the service using below command ,but i couldn't see the service on service.msc(windows service) D:\Temp\PeterKottas.DotNetCore.WindowsService.Example.exe action:install and then i have to start the console as...
When running as a console application, shutdown is only given 150ms to complete. I have a very simple application and all I'm doing in shutdown is starting an async stop...