I provided an answer in another similar question: https://stackoverflow.com/a/79761592/15891701
Here's a repeat of that answer:
Conclusion: Blazor server launched within WPF, behaves identically to a Blazor server project created directly in Visual Studio. This means that launching without a `launchSettings.json` file during debugging causes the “{PACKAGE ID/ASSEMBLY NAME}.style.css” file to generate fail. You can also notice this mirrors the effect of double-clicking an exe file in the Debug directory of an ASP.NET Core project.
So just create a launchSettings.json
file in the Properties folder with content like this, and debugging will work correctly:
{
"profiles": {
"YourProjectName": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}