I'm running a simple MVC app generated by Yeoman on my Mac using the ASP.NET vNext K runtime. I can run k kestrel
from the project directory, and everything boots up and runs just fine. However, when I hit Ctrl+C (or any other key combination I've tried), the server doesn't quit. I have to close the terminal window to get the server to shut down. What am I missing?
Kestrel is contained in a Windows service configured to restart itself automatically upon failure. As far as i know the simplest way is to return an exit code different from 0, windows will do all the rest. Environment. Exit(1);
Ctrl + Break also does the trick.
Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the web server that's included and enabled by default in ASP.NET Core project templates. Kestrel supports the following scenarios: HTTPS. HTTP/2 (except on macOS†)
If simply pressing Enter doesn't work for you, try the following in the terminal window where you're running Kestrel:
kill %1
.It turns out that simply hitting "Enter" exits kestrel cleanly, without the need to kill the mono-sgen process afterward. There is a github issue on the Kestrel repo asking to make this more obvious.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With