Hot reloading during development
Hot Reload is a feature that allows a developer to apply changes to code while the app is running and immediately see the effect. This is great for fixing bugs quickly. Hot Reload is also known as Edit and Continue. A list of the types of changes that you can make that support Hot Reload is found at the following link: https://aka.ms/dotnet/hot-reload.
Just before the release of .NET 6, a high-level Microsoft employee caused controversy by attempting to make the feature Visual Studio-only. Luckily the open-source contingent within Microsoft successfully had the decision overturned. Hot Reload remains available using the command-line tool as well.
Let’s see it in action:
- Use your preferred coding tool to add a new Console App /
console
project namedHotReloading
to theChapter04
workspace/solution.- In Visual Studio Code, select
HotReloading
as the active OmniSharp project. When you see the pop-up warning message saying...
- In Visual Studio Code, select