79392403

Date: 2025-01-27 23:21:13
Score: 2.5
Natty:
Report link

I made a similar project to you and was able to repro. I looked at the error and it seemed it was a 404 trying to get the <project_name>.styles.css. I am assuming you are getting the same issue. I did a quick google and found this GitHub Issue (it's for .NET 5 but it seems to apply to all them):

Static web assets are only enabled by default in the Development environment. If you are using a custom environment you need to call webhost.UseStaticWebAssets() to enable them explicitly.

The documentation to explicitly on how to do this can be found in the Microsoft Documentation

When running the consuming app from build output (dotnet run), static web assets are enabled by default in the Development environment. To support assets in other environments when running from build output, call UseStaticWebAssets on the host builder in Program.cs:

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): getting the same issue
  • Low reputation (1):
Posted by: jwenzel