- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.5k
Description
Describe the bug
Even though scoped CSS is supposed to be a net5.0+ only feature, it is clearly (at least partially) active in projects targetting netcoreapp3.1.
To Reproduce
- dotnet new blazorserver -f netcoreapp3.1
- echo "" > foo.razor.css
- dotnet build
We would expect a build success without scoped CSS, as a file called foo.razor.css should have absolutely no effect.
However, we get the scoped-CSS-related error
error BLAZOR102: The scoped css file 'foo.razor.css' was defined but no associated razor component was found for it.
@javiercn identified the issue here in a GH discussion as originating from https://github.com/dotnet/aspnetcore/blob/master/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets#L76
Workaround until fix is available
As @javiercn mentioned, scoped CSS can simply be deactivated in affected projects by adding <ScopedCssEnabled>false</ScopedCssEnabled> to the csproj.