command-line-api icon indicating copy to clipboard operation
command-line-api copied to clipboard

RFC: Add runAsDaemon option to UseHost

Open joemphilips opened this issue 4 years ago • 1 comments

In my own project I wanted to start Asp.Net server from command line. I also wanted to bind parsed CLI arguments into my option by BindCommandLine(), So I had to use UseHost(), which does not support running IHost forever and instead stops right after the startup.

I ended up re-writing my own commandline middleware which is mostly the same with UseHost ,but with one difference that it invokes host.RunAsync() instead of host.StartAsync(). So I thought it would be better to have this feature built in to this library.

Please don't merge yet, this PR has no test. I'm not even sure this is the right way to achieve my goal (I'm not super familiar to dotnet itself either). Any feedback is welcome.

joemphilips avatar Apr 01 '21 00:04 joemphilips

CLA assistant check
All CLA requirements met.

dnfadmin avatar Apr 01 '21 00:04 dnfadmin