.NET Hot Reload in Visual Studio Code

visibility 186 access_time 3 months ago languageEnglish timeline Stats
timeline Stats
Page index 2.89

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.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
.NET - Transform XML Data with XSLT
visibility 401
thumb_up 1
access_time 9 months ago
[Diagram] .NET Full Text Search on Azure using Apache Lucene image
visibility 52
thumb_up 0
access_time 4 months ago
.NET Full Text Search on Azure using Apache Lucene