It seems in a standard Blazor server app, the _content folder items are not being referenced correctly for anything other than the Development environment. As an example, this reference fails in any non-dev environment:
from _Host.cshtml:
<link href="_content/Blazored.Typeahead/blazored-typeahead.css" rel="stylesheet" />
To Repro, using Blazored-toast lib as an example (but any static file refs seem to have this issue):
Create a new Blazor Server project (dotnet new blazorserver)
- Add all necessary Blazored / Toast elements, including code to demo a toast message
- Test that toast is working Change launchSettings.json ASPNETCORE_ENVIRONMENT to Staging, Production, or anything other than Development
- Run program again (using ISS Express local debug), and notice the css formatting is not correct
- Change debug settings to use Kestrel instead (change IIS Express drop-down to BlazorApp1 or similar)
- Notice with kestrel, css is working fine
What am I missing that would allow this reference to work in other environments?