I\'m trying to build a Windows Service using the latest Dotnet Core 2.1 runtime. I\'m NOT hosting any aspnet, I do not want or need it to respond to http requests.
I\
IHostedService
if for [asp.net core] backendjob,
if u want to build a windows service on .net core, u should reference this package System.ServiceProcess.ServiceController, and use ServiceBase
as base class.
(you can also start from a .net framework windows service and then change the .csproj
file)
edit: please see this doc and this code https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNetCore.Hosting.WindowsServices/WebHostWindowsServiceExtensions.cs.
To create a windows service ServiceBase
for manage your IHost