Skip to content

[Hot Reload with dotnet watch] Blazor WASM Standalone hot reload reports changes applied but UI is not updated in .NET 11 Preview 6 #67611

Description

@Chakolito

Regression info: Works well with .NET11 Preview 5

Install Steps

  1. Clean machine: Win11 x64 ENU 25H2.
  2. Install .Net 11.0 preview 6 SDK.
  3. Add feed.

Repro Steps

  1. Open a normal Command Prompt.
  2. Create a Blazor WebAssembly Standalone project.
dotnet new blazorwasm -o MyBlazorWasmApp -f net11.0
  1. Run the project with dotnet watch --verbose.
  2. Open Pages/Home.razor with notepad and add a Counter component below.
<Counter />

Note:

  1. This does not repro in .NET10/9/8.
  2. This also repro with VS hot reload using http.

Actual:
Hot reload changes are not applied while the terminal will display C# and Razor changes are applied,

Image

Expected
Hot reload applies changes.
(screenshot from .NET11 Preview 5)
Image

dotnet watch --verbose logs
dotnet watch ⌚ Working directory: 'C:\Users\v-ctamayo\MyBlazorWasmApp'
dotnet watch ⌚ Watching with Hot Reload.
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
dotnet watch 💡 Press Ctrl+R to restart.
dotnet watch 🔨 Restoring C:\Users\v-ctamayo\MyBlazorWasmApp\MyBlazorWasmApp.csproj ...
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'restore C:\Users\v-ctamayo\MyBlazorWasmApp\MyBlazorWasmApp.csproj --property:NuGetInteractive=true -consoleLoggerParameters:NoSummary': process id 12808
Restore complete (0.4s)

Build succeeded in 0.9s
dotnet watch ⌚ Process id 12808 ran for 1433ms and exited with exit code 0.
dotnet watch 🔨 Project graph loaded in 0.6s.
dotnet watch 🔨 Building C:\Users\v-ctamayo\MyBlazorWasmApp\MyBlazorWasmApp.csproj ...
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'build C:\Users\v-ctamayo\MyBlazorWasmApp\MyBlazorWasmApp.csproj --property:NuGetInteractive=true --framework net11.0 --no-restore': process id 24936
    info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MyBlazorWasmApp net11.0 browser-wasm succeeded (4.2s) → bin\Debug\net11.0\wwwroot

Build succeeded in 4.8s
dotnet watch ⌚ Process id 24936 ran for 5316ms and exited with exit code 0.
dotnet watch ⌚ Loading projects ...
dotnet watch 🔨 Design-time build completed in 0.6s.
dotnet watch ⌚ Loaded 1 project(s) in 0.6s.
dotnet watch 🔨 Reading static web assets manifest file: 'C:\Users\v-ctamayo\MyBlazorWasmApp\obj\Debug\net11.0\staticwebassets.development.json'.
dotnet watch ⌚ Watching 281 file(s) for changes
dotnet watch ⌚ Exclusion glob: '**\node_modules\**;node_modules\**;**\jspm_packages\**;jspm_packages\**;**\bower_components\**;bower_components\**;**\packages.lock.json;bin\Debug\/**;obj\Debug\/**;bin\/**;obj\/**;bin\Debug\net11.0\browser-wasm\publish\/**;**/*.user;**/*.*proj;**/*.sln;**/*.slnx;**/*.vssscc;**/.DS_Store' under project 'C:\Users\v-ctamayo\MyBlazorWasmApp'
dotnet watch ⌚ Solution after project update: v1
dotnet watch 🔥 Hot reload session started.
dotnet watch ⌚ Application kind: BlazorWebAssembly.
dotnet watch 🔃 [MyBlazorWasmApp (net11.0)] Using browser-refresh middleware
dotnet watch 🔃 [MyBlazorWasmApp (net11.0)] Refresh server running at ws://localhost:53035,wss://localhost:53036.
dotnet watch 🔥 [MyBlazorWasmApp (net11.0)] Project specifies capabilities: Baseline, AddMethodToExistingType, AddStaticFieldToExistingType, NewTypeDefinition, ChangeCustomAttributes, AddInstanceFieldToExistingType, GenericAddMethodToExistingType, GenericUpdateMethod, UpdateParameters, GenericAddFieldToExistingType, AddExplicitInterfaceImplementation.
dotnet watch ⌚ Configured to launch a browser on ASP.NET Core application startup.
dotnet watch 🚀 [MyBlazorWasmApp (net11.0)] Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'run --no-build --framework net11.0 -e DOTNET_WATCH=1 -e DOTNET_WATCH_ITERATION=1 -e ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT=ws://localhost:53035,wss://localhost:53036 -e ASPNETCORE_AUTO_RELOAD_WS_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr5j99C+i1kSkPbIix4a8UxvNbAI1F7SQxee3U2K+fOKj1Cc40gRbOIT9x/Aj1ItEQhusT6D7eQykcO1rR12Puz8Z2qcFlvCVFsEPy6EYkDR/+FoD3FGt9wxAUbgyMvpjMItJm+QOor1MlJOWclLPJ/YezdX9i3TpXY4rHCDgutqaJ2OIwAfa7H7PuarKGU9AkfMlo4qbe7F19ueFhvf+kVTyVcUhnTwBOBwQ1UtESKzJIRvp57+x7VuSo5VGdPO7nKbBPmORmhdm2dFKBqpWjeLaiJSDeEY6hCZpQMpcQuvKdD4hZMIHuOG9INsFPyKKHBI+PuzWpXj6aE8Aee7vkQIDAQAB -e ASPNETCORE_AUTO_RELOAD_VDIR=/ -e "DOTNET_STARTUP_HOOKS=C:\Program Files\dotnet\sdk\11.0.100-preview.6.26351.113\DotnetTools\dotnet-watch\11.0.100-preview.6.26351.113\tools\net11.0\any\hotreload\net6.0\Microsoft.AspNetCore.Watch.BrowserRefresh.dll" -e ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.AspNetCore.Watch.BrowserRefresh -e DOTNET_MODIFIABLE_ASSEMBLIES=debug': process id 7640
dotnet watch ⌚ Waiting for changes
Using launch settings from C:\Users\v-ctamayo\MyBlazorWasmApp\Properties\launchSettings.json...
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5103
dotnet watch ⌚ Launching browser: http://localhost:5103
dotnet watch 🚀 Launched 'http://localhost:5103' with arguments '': process id 22080
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\v-ctamayo\MyBlazorWasmApp
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
dotnet watch ⌚ File change: Update 'C:\Users\v-ctamayo\MyBlazorWasmApp\Pages\Home.razor'.
dotnet watch ⌚ File change: Update 'C:\Users\v-ctamayo\MyBlazorWasmApp\Pages\Home.razor'.
dotnet watch ⌚ File updated: .\Pages\Home.razor
dotnet watch ⌚ Updating document text of 'C:\Users\v-ctamayo\MyBlazorWasmApp\Pages\Home.razor'.
dotnet watch ⌚ Solution after document update: v2
dotnet watch 🔥 Hot reload capabilities: AddExplicitInterfaceImplementation AddInstanceFieldToExistingType AddMethodToExistingType AddStaticFieldToExistingType Baseline ChangeCustomAttributes GenericAddFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod NewTypeDefinition UpdateParameters.
dotnet watch 🔃 [MyBlazorWasmApp (net11.0)] Updating diagnostics.
dotnet watch 🔃 [MyBlazorWasmApp (net11.0)] No browser is connected.
dotnet watch 🔥 [MyBlazorWasmApp (net11.0)] Sending update batch #0
dotnet watch 🔃 [MyBlazorWasmApp (net11.0)] No browser is connected.
dotnet watch 🔥 C# and Razor changes applied in 769ms.
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions