Apparently, this is a feature for Asp.Net as well, and has been for quite some time. With .Net 5, it is even more comfortable, as it can be handled fully through the command that launches the Kestrel server.
Previously, I used this command to start:
dotnet run --project GoodNight.Service.Api
command, which represents the auto-rebuilding behaviour. It wants as arguments the
dotnet command that should be supervised and restarted as required. For running the server, use this command:
dotnet watch --project GoodNight.Service.Api run
Observe that the
run command as moved behind the
--project flag: watch wants the project setting for itself, and will not launch without it. Luckily, it passes it on onto the child command.