microsoft / microsoft/vscode-dotnettools

[WebToolsE2E][Hot Reload] Hot Reload fails after "Start new Instance" in Blazor WASM with ENC2018 and "Assembly updates cannot be applied while a debugger is attached"

Open
#3,365 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fixed
Dominant language
No language data
Stars
321
Forks
54
Avg merge
2d 19h
Merged PRs (30d)
2

Description

REGRESSION INFO: In C# Dev Kit May Prerelease 9 (3.29.195) this issue will be encounter instead 3417

INSTALL STEPS

  1. OS: window x64
  2. Install SDK 10.0.400
  3. Install VS Code Insider - 1.135.0
  4. Install May Prerelease 10 C# DK : 3.31.199
  5. Install May Prerelease 10 C#: 2.149.34

REPRO STEPS

  1. Make sure enable "[Experimental] Enables C# Hot Reload while debugging"
  2. Open VS Code > Create .NET Project > Blazor Web App ~ Auto ~ Per page/component
  3. Build project successfully.
  4. Right click the csproj >debug >Start new Instance
  5. Components > Change code from Home.razor h1 to:
    <h1>Hello, worldssss!</h1>
  6. Trigger hot reload

Note:

  • Repro in Auto + Per/Page Component
  • Repro in Auto + Global
  • Repro WASM + Per/Page Component
  • Repro in WASM + Global
  • Repro in Blazor WebAssembly Standalone App
  • Not repro in Server + Per/Page Component
  • Not repro in Server + Global
  • Rerunning the project will still not work and will encounter the same issue

ACTUAL
A pop up warning will show that Hot Reload applied changes requires a full restart
Image
Logs:

2026-07-31 10:24:48.535 [error]  C:\Users\v-jbolocon\Downloads\BlazorApp13\BlazorApp13\BlazorApp13\obj\Debug\net10.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Components/Pages/Home_razor.g.cs (line 1): error ENC2018: Changes made in project 'BlazorApp13' require restarting the application: `

After clicking "Rebuild and apply Changes" there will be a warning and Hot Reload does not work

Image Logs:
2026-07-31 10:26:15.490 [info]  Hot Reload: Rebuild in progress
2026-07-31 10:26:20.132 [info]  Hot Reload: Rebuild completed
2026-07-31 10:26:20.150 [info]  Code changes were successfully applied.
2026-07-31 10:26:20.202 [info]  No code changes were found.
2026-07-31 10:26:38.448 [error]  BlazorApp13 (net10.0):2: The runtime failed to applying the change: Assembly updates cannot be applied while a debugger is attached.
2026-07-31 10:26:38.449 [warning]  BlazorApp13 (net10.0):2: Further changes won't be applied to this process.
2026-07-31 10:26:38.450 [warning]  BlazorApp13 (net10.0):2: Further changes won't be applied to this process.
2026-07-31 10:26:38.467 [info]  Code changes were successfully applied.

EXPECTED
Triggering hot reload will apply changes successfully without errors

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the listed SDK, VS Code Insider, C# Dev Kit, and C# extension versions using a Blazor WebAssembly project, then inspect the csproj debug Start new Instance path and the Home.razor edit. Compare the successful Server cases with the WASM cases and use the ENC2018 and debugger-attached logs as the failure criteria; done means hot reload applies the edit without requiring a restart or producing errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, vscode, wasm
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.