You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I'm seeing the following issue after the merge of this into 9.0.2xx
dotnet watch ⌚ File updated: /Users/me/RiderProjects/Shared.Frontend/Components/Shared/Buttons/MyButton.razor.css
dotnet watch ⌚ [Web (net9.0)] Exited
dotnet watch ⌚ [ApiService (net9.0)] Exited
dotnet watch ⌚ [Admin (net9.0)] Exited
dotnet watch ⌚ [AppHost (net9.0)] Exited
dotnet watch ⏳ Waiting for a file to change before restarting ...
dotnet watch ❌ System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Watch.ScopedCssFileHandler.HandleBrowserRefresh(BrowserRefreshServer browserRefreshServer, String containingProjectPath, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.ScopedCssFileHandler.<>c__DisplayClass5_0.<<HandleFileChangesAsync>b__2>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.DotNet.Watch.ScopedCssFileHandler.HandleFileChangesAsync(IReadOnlyList`1 files, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.Program.RunAsync()
dotnet watch ❌ An unexpected error occurred
Process finished with exit code 1.
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
net8.0
folder rundotnet watch
against theCssIsolationIssue.sln
solutionRazorClassLibrary\Components\Example.razor.css
change the color from red to bluedotnet watch
will reload the page and the color of theHello World
text will change:net9.0
folder rundotnet watch
against theCssIsolationIssue.sln
solutionRazorClassLibrary\Components\Example.razor.css
change the color from red to bluedotnet watch
will detect the change but no CSS is reloaded on the page:Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: