Hot reload
When running in the development mode, DotVVM watches markup files for changes, and recompiles them without the need to restart the web application process.
Additionally, there are DotVVM.HotReload.AspNetCore and DotVVM.HotReload.Owin packages that will inject a simple JavaScript in the page that will reload the page automatically while preserving the viewmodel state.
Thus, when working on your DotVVM pages, you can just run the DotVVM application once and edit the markup files in your IDE. When you save the file, the page loaded in the browser will reflect the changes immediately.
Configuration
When you create a DotVVM application, Hot reload is already configured. To add it manually, you need to perform the following steps:
Install
DotVVM.HotReload.AspNetCoreNuGet package.In
Program.cs(orStartup.csfile), add the following line after the call toUseDotVVM:app.UseDotvvmHotReload();In the
ConfigureServicesinDotvvmStartup.cs, add the following line:public void ConfigureServices(IDotvvmServiceCollection services) { services.AddHotReload(); ... }Ensure you run the application with
ASPNETCORE_ENVIRONMENT=Development. You can check this inProperties/launchSettings.json, or you can see it in the console output of the application. See the Debug mode section for more details.