Skip to content

Hot reload / dotnet watch not fully working in .NET 8 preview 5 #48796

@mrpmorris

Description

@mrpmorris

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

dotnet watch will update the browser when the project itself changes, but not when a dependent project changes (Razor class library).

VS hot reload doesn't update the browser at all.

Expected Behavior

UI should update.

Steps To Reproduce

  1. New Blazor WASM solution + app
  2. Create a new Razor Class Library
  3. Add a reference from the WASM app to the class library
  4. Add Component1 to Index.razor

Scenario 1: dotnet watch

  1. From a command prompt run
dotnet watch --project .\WasmApp\WaspApp.csproj
  1. Edit the text in Index.razor and save
  2. Edit the text in Component1.razor and save

Expected: Both changes should update the UI
Actual: Only changes to Index.razor update the UI

Scenario 2: Hot reload

  1. Run the app
  2. Ensure Hot Reload is enabled, and set to trigger when a file is saved
  3. Edit the text in Index.razor and save
  4. Edit the text in Component1.razor and save

Expected: Both changes should update the UI
Actual: No changes are seen unless the page is refreshed in the browser.

Exceptions (if any)

No response

.NET Version

8.0.100-preview.5.23303.2

Anything else?

dotnet --version
8.0.100-preview.5.23303.2

C:\Users\Admin>dotnet --info
.NET SDK:
Version: 8.0.100-preview.5.23303.2
Commit: 3fe444af72

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.5.23303.2\

.NET workloads installed:
There are no installed workloads to display.

Host:
Version: 8.0.0-preview.5.23280.8
Architecture: x64
Commit: bc78804f5d

.NET SDKs installed:
6.0.408 [C:\Program Files\dotnet\sdk]
7.0.302 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23274.1 [C:\Program Files\dotnet\sdk]
8.0.100-preview.5.23303.2 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.5.23280.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-hot-reloadThis issue is related to the Hot Reload feaature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions