.NET Hot Reload in Visual Studio Code
Hot Reload is a very useful feature that is introduced in Visual Studio to enable developers to save the time to restart applications after live code editing. It can improve your productivity when developing solutions in Visual Studio. This page shows you how to do that in Visual Studio Code.
Create launch profile with hot reload
In .NET launchable projects like console, website and others, create launch profile in folder Properties\launchSettings.json. You can add profiles in "profiles"
property in the document:
"profiles": {"hotreloadprofile": {"commandName": "Project","launchBrowser": true,"environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development","Key": "Value"},"applicationUrl": "https://localhost:5001;http://localhost:5000","hotReloadProfile": "aspnetcore"} }
Remembers to add hotReloadProfile
property accordingly.
Depends on the project type, the possible values are:
- Blazor WebAssembly:
blazorwasm
- ASP.NET Core application:
aspnetcore
Launch application with hot reload
Now you can use the following command line to launch the application with hot reload:
dotnet watch run --launch-profile hotreloadprofile
copyright
This page is subject to Site terms.
comment Comments
No comments yet.
Log in with external accounts
warning Please login first to view stats information.
article
Instantiate a Service in ConfigureServices Method in .NET Core
article
The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'.
article
EntityFramework Core - Update Only One Field
article
Logging configuration in .NET core
article
Azure Function App - Failed to start a new language worker for runtime: dotnet-isolated
Read more (37)