-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Pillar: Dev Experiencearea-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-css-isolationThis issue is related to CSS Isolation featureThis issue is related to CSS Isolation featurefeature-dotnetwatchThis issue is related to the dotnet-watch command-line tool (now external)This issue is related to the dotnet-watch command-line tool (now external)feature-hot-reloadThis issue is related to the Hot Reload feaatureThis issue is related to the Hot Reload feaaturetriaged
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
This may be a duplicate of #37592, except that was closed as fixed, and the bug is still present.
When running dotnet watch
and editing a .razor.css
file in the main application, it will "reload scoped css" but this discards CSS from referenced libraries.
Expected Behavior
All CSS should remain loaded.
Steps To Reproduce
- Clone https://github.com/uecasm/HotReloadStyles.git
- Launch with
dotnet watch
- Observe that, as expected, the scoped styles from both
Index.razor.css
in the main app andComponent1.razor.css
in the library have been merged, resulting in (including border, padding, and green background):
- Simply re-save the
Index.razor.css
file without making any changes. - Observe that, not as expected, the
Index.razor.css
styles still apply but theComponent1.razor.css
styles have been lost (no border or padding but still green background):
- Press Ctrl-R or relaunch
dotnet watch
and observe that all styles are loaded again.
Possibly also of note is that editing the Component1.razor.css
file does update the styles if editing Index.razor.css
has not yet unloaded them, but does not restore them after it has.
Exceptions (if any)
No response
.NET Version
6.0.300
Anything else?
.NET SDK (reflecting any global.json):
Version: 6.0.300
Commit: 8473146e7d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.300\
Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6
.NET SDKs installed:
2.1.511 [C:\Program Files\dotnet\sdk]
6.0.200 [C:\Program Files\dotnet\sdk]
6.0.300 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
jvalkeejarvi, supertr0n, IvarMyrstad and rogihee
Metadata
Metadata
Assignees
Labels
Pillar: Dev Experiencearea-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-css-isolationThis issue is related to CSS Isolation featureThis issue is related to CSS Isolation featurefeature-dotnetwatchThis issue is related to the dotnet-watch command-line tool (now external)This issue is related to the dotnet-watch command-line tool (now external)feature-hot-reloadThis issue is related to the Hot Reload feaatureThis issue is related to the Hot Reload feaaturetriaged