aspnetcore: Hot reloading fails after the second change of a razor file
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Making a change to a .razor file no longer applies consistently after upgrading to .NET 9. I am using macOS 15.0.1 on a MacBook Pro M1 (could be related).
Expected Behavior
All changes should be hot-reloaded, not just the first one. This used to work in .NET 8.
Steps To Reproduce
- Create a new app by running
dotnet new blazor -int Auto -o Blazor9Autoin some directory (from command prompt). - Run the application
dotnet watch --project Blazor9Auto/Blazor9Auto.csprojThis should open the browser. - Open Blazor9Auto/Components/Pages/Home.razor and change it somehow then save it. Make a few changes and save a few times.
Exceptions (if any)
Change failed to apply (error code: '00-00-00-00-00'). Further changes won't be applied to this process.
.NET Version
9.0.100
Anything else?
ASP.NET Core version:
9.0.0
The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version:
Tested with VS Code, vim. The editor doesn’t seem to matter.
Include the output of dotnet --info:
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.3068a692
MSBuild version: 17.12.7+5b8665660
Runtime Environment:
OS Name: Mac OS X
OS Version: 15.0
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.100/
.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: arm64
Commit: 9d5a6a9aa4
.NET SDKs installed:
6.0.406 [/usr/local/share/dotnet/sdk]
7.0.403 [/usr/local/share/dotnet/sdk]
8.0.403 [/usr/local/share/dotnet/sdk]
9.0.100 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 18
- Comments: 39 (13 by maintainers)
@willdean Should be in 9.0.x. Working on a fix already.
Tracked here: https://github.com/dotnet/sdk/issues/44912 Should be fixed by: https://github.com/dotnet/sdk/pull/45097
Very concerned to see this marked as planned for .NET 10.
Is there an appreciation within MS that, for some of us,
dotnet watchis unusable in 9.0 (at least for Blazor dev) and that is going to block us from moving to 9 at all?Even the simplest (I know hot reload is not simple at all, but it used to work) stuff, like adding a class name to an element on a Blazor Server (i.e. no WASM magic) project, is now not reliably carried through to the browser. Sometimes DNW thinks there are no updates though there are, sometimes other compiler errors appear (e.g. suddenly starts thinking that components are elements and warning about that), sometimes it does update but much slower than 8.0. Sometimes the code updates but the browser has to be refreshed by hand.
Using
dotnet watchfor styling Blazor Server projects output was basically seamless in 8 - you could add a class, hit save and by the time you’d shifted your gaze to the other monitor the page would be updated. In 9 this has all gone. At best its slower, and mostly it’s broken.I hoped that maybe @danroth27 had a grip on this as someone who must appreciate that the hot-reload story is utterly vital to Blazor’s success, but when I see “Net 10 Planning” appear as a milestone I wonder if we’re going to have to skip an entire release cycle.
Hello, I confirm that even with the new .NET 9 update (9.0.102) and a Blazor Server application, hot reload works two or three times and then stops working. I’m on Mac x64 with Sonoma 14.6.1.
Here are a few more tests that I conducted.
.NET 8 Blazor app with Auto interactivity
I tested an existing .NET 8 app created long before installing .NET 9 (
dotnet new blazor -int Auto -o Blazor8Auto). Running the app now (with .NET 9) has the same issue. The second save of Home.razor outputs❌ [Blazor8Auto (net8.0)] Change failed to apply (error code: '00-00-00-00-00'). Further changes won't be applied to this process..Adding a global.json with the following content solves the problem completely:
I can update Home.razor many times and the error does not appear.
.NET 9 Blazor app with Server interactivity
I then created a server interactivity app to eliminate issues related to WASM runtime loading. To do that I used
dotnet new blazor -int Server -o Blazor9Server. I observed the exact same thing after saving Home.razor a second time:.NET 9 Blazor app without interactivity
Then I created a Blazor app without interactivity via
dotnet new blazor -o Blazor9. The same error was output after the second time I updated Home.razor.Those tests made me think that:
For completeness purposes I tested on a different Mac with the same results. Also tried with different browsers - the results were the same.
Here’s mine which doesn’t sound exactly like the above, but people have added comments that do: https://github.com/dotnet/sdk/issues/44912
Here’s another which is more like mine: https://github.com/dotnet/sdk/issues/44910
Here;'s one which references Blazor: https://github.com/dotnet/sdk/issues/44384
Hi folks. Sorry about the confusion on this one. This fix did not make it in for 9.0.102, but it will be released shortly in the next .NET SDK servicing release in Feb: 9.0.103 and 9.0.200.
@timohermans I believe this fix will be in the
9.0.1 patch in Jan9.0.103 & 9.0.200 release in Feb.I installed the latest 9.0.300 preview with
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 9.0.3xx --quality daily, which fixed the hot-reloading issues for me.I got the same issue running on a Linux host inside a Docker container, using latest image
mcr.microsoft.com/dotnet/sdk:9.0Can confirm hot reload works again in my project 😄.
Same issue for me (works once or twice, then fails) with dotnet 9.0.102 and Mac Sequoia 15.3.
I’m not sure if I understand if this will be fixed in .NET 9.0.2 of if it’s already live in 9.0.1, but I still have the “Change failed to apply (error code: ‘00-00-00-00-00’). Further changes won’t be applied to this process.” error when I try to make a change in a .NET 8 project. Am I missing something?
I’m running Ubuntu 24.04 with the latest .NET 9.0 version and am facing the exact same issues