-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet 9, "dotnet watch" is really bad in Blazor Server #45810
Comments
It would be nice if Microsoft could acknowledge this problem and provide a clear ETA for the fix. |
It's just as awful in Blazor WASM projects too. Without any other code changes besides updating to .NET 9 and targeting .NET 9 in our projects, Hot Reload went from being something we could depend on and be reliable, to a hot garbage mess that barely functions, even in an ASP.NET Core Web API project, but is especially awful in Blazor projects. Sad to say it, but we just might have to give .NET 9 a pass and go back to .NET 8 if this isn't resolved soon. |
I'm going to add a me-too, because we all know there's nothing motivates MS quite like a thousand-post Github issue... This is a blocker on 9 as far as we're concerned and I'm really disappointed that yesterday's release (representing ~17% of the whole release cycle) has failed to make a difference. TBH, looking in from outside via GH, the whole dotnet project looks poorly, but Blazor particularly so. At least there's a bright side - if we don't move to 9 because of |
Same... I've noticed that I've been manually restarting the Blazor Server a lot more frequently in 9. |
Same. Have been test upgrading and downgrading for weeks now. Come on MS - surely you have the budget to fix one of the most core parts of the MS Dev experience- hot reload! @danroth27 save us! |
Just for reference this worked perfectly in .NET 8 (Blazor server and client components in a razor page project) - file save pushed hot reload in about 1 second.
|
Using Visual Studio IIS hot reload in .NET 9 - click save, count to 200 and you might get an update. What is happening here!! |
@aaronsmithuk @qucee98 @breakingram @willdean @XorZy @stephajn Are you still seeing problems with .NET SDK 9.0.102 that released earlier this week? Note that the corresponding 9.0.200 preview update hasn't shipped yet, but should be available later this month. |
Yes. It seems about the same as before. (Blazor Server, .NET8 project) |
@danroth27 I just updated to the new 9.0.102 SDK yesterday, and updated all of my NuGet packages to the 9.0.1 versions today. I tried it out with something that we commonly do and immediately the same old problems sprang up. I have a standalone Blazor WASM project that I will call ProjectA. It references another Razor class library project that I will call ProjectShared, along with other class library projects etc. With hot reload enabled via running dotnet watch ⌚ File added: .\Pages\Accounting\TaxReceiptsList.razor~ And this is fair. It's what .NET 8 called a "rude edit". So of course it asked me what I wanted to do going forward, so I selected to always restart when needed. ❔ Do you want to restart your app? Yes (y) / No (n) / Always (a) / Never (v) Using launch settings from C:\source\ProjectA\Properties\launchSettings.json... Except that no changes were made at all in that project. I made a change in literally one .razor file in ProjectA. After a short time, the application finished restarting, and uselessly opened up a new tab in my browser rather than reloading the existing tab I had open like .NET 8 used to do. Every time the application has to restart it opens a new tab. This is also a completely useless behaviour to me because I want to stay in the tab I was using, and I want to stay on the page I was using rather than starting up from the home page of my application. Also, this business described above of "too many changes at once" in a project where no change was made is something that only started in .NET 9. We never encountered this in .NET 8. This is just one behaviour I have seen in .NET 9 in Blazor development when it comes to hot reload. For even simpler changes like changing a button colour, it can take 30 - 60 seconds for hot reload to apply these changes. I should also note that I am using Windows 11 Pro on an Intel i7-12700K with 32 GB of RAM and a 1 TB SSD, so I definitely can't blame my system for being underpowered, especially since none of this was a problem on .NET 8. Also, I'm developing using the latest Chrome. I have also tried Edge to see if there is any difference in hot reload changes being applied and it is just as unreliable. I hope that this helps. |
@danroth27 I wanted to give you even more feedback at the server layer regarding Hot Reload. This is for an ASP.NET Core Web API project also running on .NET 9. (Perhaps a different team / issue is needed, but I'm not sure) Added a new server endpoint on an existing Web API Controller while dotnet watch ⌚ File added: .\Controllers\SomeApiController.cs~ Again, I hope that this is helpful or useful to you. |
@willdean @stephajn Thanks for these additional details. @phil-allen-msft @tmat Do we know what's going on here? |
Sounds like multiple potential issues. Any repro with the latest 9.0.2xx build? |
This is fixed by dotnet/aspnetcore#58558 in 10.0 preview. |
Any chance of back-porting it to .NET 9? |
@tmat I don't have a repro available to recreate this issue, sorry. I could see if I can put something together though. |
I'm also adding a me-too. Using it in combination with aspire. I do know this won't be supported until 9.0.2xx but the fact that it worked way better in .NET 8 than in .NET 9 is disappointing. Aspire support was why I was ok with using the 9.0.2xx daily builds and since about 1 week it's actually usable now. Did open a issue on the sdk repo about this. #45197 |
I have this issue in .NET 8 + .NET 9
Hot reload worked fine before .NET 6 with Rider, since it's an "official" feature it's not longer working ever. All my colleagues distrust the "Apply Changes" and restart their aspnetcore app every time which makes development very slow. Especially if you just edit a razor (HTML) file. I tried |
It appears hot reload of scoped CSS works better in 9.0.102 but overall it still is very slow and crashes often with this error message.
|
@XorZy Could you please provide repro steps? Ideally in a new issue. |
@XorZy same issue
|
I've seen regressions in Hot Reload sometimes work, maybe 50% of the time for things that are not of the "rude edit" variety. But I want to highlight something that @stephajn mentioned:
I see the same behavior, even in the simplest WASM standalone project. This behavior really interrupts the development loop, as it means closing the old browser tab, going to the new one, and re-opening browser DevTools, in addition to being dropped in the home page of the app rather than the one I was working on. I've created a separate issue for this behavior: #46175 |
The good news is that dotnet sdk
|
@stephajn Yes, the back port to .NET 9 is in the works here: dotnet/aspnetcore#59908 |
We believe the original issue reported here is fixed in the latest preview release of .NET SDK 9.0.200, which is available with the latest preview of Visual Studio 17.13. A stable release of 9.0.200 should be available in a few weeks. We expect to address warning about the missing We'll follow up on the other separate issues reported here in their corresponding GitHub issues. Thanks for your patience, folks. |
Environment:
hot reloading just sucks in dotnet 9 when using Blazor Server... 🤷♂️
I migrated my project from .net 8 to .net 9 and followed this doc:
dotnet watch
command seems to be inconsistent in reloading the page when making changes to my current buffer.When it starts to NOT work, then it never works after any changes, i have to restart the project manually.
".NET 9.0.200" patched it a bit, but hot reloading is still inconsistent in reloading the changes.
#44912
#45749
#45097
#45131
"Hot Reloading"? more like "Hot Mess".
Switching back to .NET 8 until y'all get your stuff together....
The text was updated successfully, but these errors were encountered: