Blazor CSS isolation not working with any ASPNETCORE_ENVIRONMENT other than Development #28650
Labels
area-blazor
Includes: Blazor, Razor Components
feature-css-isolation
This issue is related to CSS Isolation feature
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Describe the bug
The CSS isolation feature in Blazor (at least for Blazor Server) is not working for any ASPNETCORE_ENVIRONMENT other than "Development". As soon as I change the environment variable, the generated CSS file is empty.
To Reproduce
The reproduction is pretty simple. Just create a new Blazor Server app using
dotnet new blazorserver
and change the ASPNETCORE_ENVIRONMENT setting inlaunchSettings.json
from "Development" to anything else like "Production".Then
dotnet run
the project and you can see that the CSS is missing.You can see the minimal example in my sample repo: https://github.com/n-develop/BlazorCssIsolation
Further technical details
dotnet --info
output:The text was updated successfully, but these errors were encountered: