After installing nuget package Microsoft.AspNetCore.Hosting.WindowsServices 2.0 It is not working because this package was created only for 4.6.1
I was install 2.1.0-preview2-final.
Ok, with host.RunAsService() it is compiling but not working when I start it via cmd
And I have this message:
Cannot start service from the command line or a debugger. A Windows Service must first be installed and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.
How to install my project as a Windows Service?
This post Is is possible to host a ASP.NET Core 2 Web API NET Core 2 application in Windows Service targeting do not helps me.
And it is 3rd part tool, it is overhead.