Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
A Blazor Web App using MapStaticAssets and the Assets[] on linked css files will generate unique urls that do not exist once the project is published.
The css files are in the project output wwwroot but without the hashes found in the links.



Expected Behavior
When I run the project from Visual Studio or the command line, dotnet run
, it works as expected with the content of the css files being served from the hashed filenames.
Steps To Reproduce
- Create a new Blazor Web App project in Visual Studio

- dotnet publish -o _publish/
- dotnet _publish/BlazorApp1.dll
- Open the website at http://localhost:5000
- Notice the styling is missing
- View source, open the css file, return zero length file, HTTP 200
Exceptions (if any)
No response
.NET Version
9.0.302
Anything else?
Microsoft Visual Studio Community 2022
Version 17.14.8
VisualStudio.17.Release/17.14.8+36301.6
Microsoft .NET Framework
Version 4.8.09032
Installed Version: Community
ASP.NET and Web Tools 17.14.114.53116
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.14.114.53116
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 17.14.114.53116
Azure Functions and Web Jobs Tools
C# Tools 4.14.0-3.25326.11+bd4f2062291278e0df1e3fd3180c0c862495a3a7
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
GitHub Copilot 17.14.827.52834
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
NuGet Package Manager 6.14.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.14.3.2530601+3372435431977e91904a23ceb1eab689badc1bd9
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.14.26.0
Microsoft SQL Server Data Tools
TypeScript Tools 17.0.40502.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.14.0-3.25326.11+bd4f2062291278e0df1e3fd3180c0c862495a3a7
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.14.0-beta.25230.7+c1a9d78ad4a474a716ccffb4367ed5151e3f7c9f
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
Web Compiler 1.14.15
Compiler for LESS, Sass and CoffeeScript files