Events
Nov 19, 11 PM - Nov 21, 11 PM
Join online sessions at Microsoft Ignite created to expand your skills and help you tackle today's complex issues.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
.NET Hot Reload applies code changes, including changes to stylesheets, to a running app without restarting the app and without losing app state. Hot Reload is supported for all ASP.NET Core 6.0 and later projects.
Generally, updated code is rerun to take effect with the following conditions:
OnInitialized
).For more information on supported scenarios, see Supported code changes (C# and Visual Basic).
Blazor WebAssembly Hot Reload supports the following code changes:
this
to existing methods that already captured this
previously.Note that when an attribute is removed that previously set the value of a component parameter, the component is disposed and re-initialized to set the removed parameter back to its default value.
The following code changes aren't supported for Blazor WebAssembly apps:
await
operator or yield
keyword expression.Blazor WebAssembly Hot Reload supports the following code changes:
this
to existing methods that already captured this
previously.Note that when an attribute is removed that previously set the value of a component parameter, the component is disposed and re-initialized to set the removed parameter back to its default value.
The following code changes aren't supported for Blazor WebAssembly apps:
await
operator or yield
keyword expression.static
) fields, events, or properties.Blazor WebAssembly Hot Reload supports the following code changes:
The following code changes aren't supported for Blazor WebAssembly apps:
await
operator or yield
keyword expression.static
) fields, events, or properties.Hot Reload is activated using the dotnet watch
command:
dotnet watch
To force the app to rebuild and restart, use the keyboard combination Ctrl+R in the command shell.
When an unsupported code edit is made, called a rude edit, dotnet watch
asks you if you want to restart the app:
To disable support for Hot Reload, pass the --no-hot-reload
option to the dotnet watch
command:
dotnet watch --no-hot-reload
The following setting in Properties/launchSettings.json
disables Hot Reload:
"hotReloadEnabled" : false
For more information, see the following resources in the Visual Studio documentation:
ASP.NET Core feedback
ASP.NET Core is an open source project. Select a link to provide feedback:
Events
Nov 19, 11 PM - Nov 21, 11 PM
Join online sessions at Microsoft Ignite created to expand your skills and help you tackle today's complex issues.
Register now