This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
Create a sample using Microsoft.AspNetCore.Hosting.WindowsServices #771
Closed
Description
I am trying to get an RC2 web sample hosted as windows service up and running using Microsoft.AspNetCore.Hosting.WindowsServices
..
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.Build();
host.RunAsService();
}
}
.. the RunAsService
extension method says it blocks until the service is stopped but currently it seems to be running the Startup over and over again.
(I have a simple log message inside the Configure
method). Not sure if this is a bug or I am doing something wrong.
If someone could create a working sample it would be really useful to check against.