I'm working on an ASP.NET Core MVC application in Rider in which I'm frequently editing the code and as a result having to repeatedly manually stop and start the application, which is highly inconvenient.
To solve this, I tried various approaches:
- Rebuilding the application while running doesn't work. First, I get a warning:
If I click build, the solution is rebuilt, but any code changes aren't reflected in the running web server. E.g if I changed the string
"welcome"
to"goodbye"
, rebuilding still showswelcome
after rebuilding. dotnet watch run
. Adding this command as an external tool to run in the pre-launch configuration does get save-based recompilation working. However, this doesn't integrate with the built-in runner. Sincedotnet watch run
starts its own web server, Rider's run command never actually runs. As a result, Rider doesn't detect that the application has started running, but instead thinks thatdotnet watch run
is some pre-launch task to begin before running. With debugging, I am unable to hit any breakpoints for this reason as well.
Is there any other way I can quickly rebuild an ASP.NET Core project while running it?