I'm using RazorPages. The css isolation feature allows any razor page to have an associated css file, e.g. Products.cshtml and Products.cshtml.css.
The runtime automatically bundles all such css files into ~/www/ProjectName.styles.css. And in production there is ~/www/ProjectName.styles.min.css.
The layout page should have this: <link rel="stylesheet" href="~/ProjectName.styles.css" asp-append-version="true" />
All the above is from the official dotnet new templates.
But when running, the logs show:
An unhandled exception has occurred while executing the request.
System.IO.FileNotFoundException: Could not find file '/home/username/ProjectName/wwwroot/ProjectName.styles.css'.
File name: '/home/username/ProjectName/wwwroot/ProjectName.styles.css'
It cannot find the file because it's dynamically created - it doesn't even exist on disk.
I don't know if this is possible, or a bug.
I'm using RazorPages. The css isolation feature allows any razor page to have an associated css file, e.g.
Products.cshtml
andProducts.cshtml.css
.The runtime automatically bundles all such css files into
~/www/ProjectName.styles.css
. And in production there is~/www/ProjectName.styles.min.css
.The layout page should have this:
<link rel="stylesheet" href="~/ProjectName.styles.css" asp-append-version="true" />
All the above is from the official
dotnet new
templates.But when running, the logs show:
It cannot find the file because it's dynamically created - it doesn't even exist on disk.
How do I deal with this?