-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Describe the bug
After upgrading our tooling to NET 9.0, the dotnet watch command is no longer actively reloading CSS when changes are made to referenced Razor Class Library projects using CSS Isolation.
On NET 8.0 after making a change to a Component's CSS, the bundled CSS is reloaded and the page is updated. On NET 9.0, dotnet watch detects the change and says it has reloaded the CSS but no changes are made to the page and no new CSS is retrieved in the Network tab of the browsers debug tools.
To Reproduce
Repo: https://github.com/pcannon-b2w/dotnet-watch-regression
- From the
net8.0folder rundotnet watchagainst theCssIsolationIssue.slnsolution - In
RazorClassLibrary\Components\Example.razor.csschange the color from red to blue - Save
dotnet watch will reload the page and the color of the Hello World text will change:
dotnet watch ⌚ File changed: D:\Code\dotnet-watch-regression\net8.0\RazorClassLibrary\Components\Example.razor.css.
dotnet watch 🔥 Hot reload of scoped css succeeded.
- From the
net9.0folder rundotnet watchagainst theCssIsolationIssue.slnsolution - In
RazorClassLibrary\Components\Example.razor.csschange the color from red to blue - Save
dotnet watch will detect the change but no CSS is reloaded on the page:
dotnet watch ⌚ File added: D:\Code\dotnet-watch-regression\net9.0\RazorClassLibrary\Components\Example.razor.css~
dotnet watch ⌚ File updated: D:\Code\dotnet-watch-regression\net9.0\RazorClassLibrary\Components\Example.razor.css
dotnet watch ⌚ File added: D:\Code\dotnet-watch-regression\net9.0\RazorClassLibrary\Components\Example.razor.css~
dotnet watch ⌚ File updated: D:\Code\dotnet-watch-regression\net9.0\RazorClassLibrary\Components\Example.razor.css
dotnet watch 🔥 Hot reload of scoped css succeeded.
dotnet watch ⌚ No hot reload changes to apply.
Further technical details
- Include the output of
dotnet --info
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\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: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [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:
D:\Code\dotnet-watch-regression\net9.0\global.json
periapsistech, vertonghenb, rogihee, dodyg, stsrki and 2 more

