Open Tornhoof opened 1 day ago
Same here, except that fingerprinting is actually doing its thing but a wrong fingerprint is used.
@ViRuSTriNiTy can you file a separate issue and provide a repro?
@Tornhoof thanks for contacting us.
I have multiple blazor WebApp as Razor Class libraries distributed as nuget packages
This is not a supported scenario.
But now with fingerprinting, the bundle has no fixed name anymore. Fingerprinting can be disabled via the rather undocumented csproj setting "StaticWebAssetFingerprintingEnabled" (thanks to @ViRuSTriNiTy who told me that in Discussions https://github.com/dotnet/aspnetcore/discussions/58910), but that does not disable fingerprinting with externally packaged nugets like Quickgrid.
The .bundle.scp.css
files have always been an implementation detail, not something that your app should directly reference or depend on.
With all that out of the way, have you used the `Assets["path"] syntax in your app? That will translate the non-fingerprinted name to the fingerprinted name (same thing as what happens in the regular templates).
This is not a supported scenario.
Can you please elaborate, is bundling/css isolation/Static webassets not supported or are Blazor Web Apps from a different route than wwwroot not supported, i.e. where wwwroot is owned by an SPA and blazor is /myblazorapp.
The .bundle.scp.css files have always been an implementation detail, not something that your app should directly reference or depend on.
You might want to make that very clear here: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-9.0
With all that out of the way
Yes that's the state of the repro, depending on MapStaticAssets(manifest)
, if I use the manifest of the rcl there It will resolve the fingerprinted files, but they are length 0. Without the manifest they are not resolved, which makes sense if the whole thing only works with blazor as the entry point. I expect that using a manifest breaks after publishing anyway.
Looks like I need to get rid of bundling/css isolation etc and put everything back into app.css directly.
Is there an existing issue for this?
Describe the bug
Having a Razor Class Library with the new Static Web Assets with Fingerprinting enabled does not load the bundled and fingerprinted main asset ProjectName.bundle..scp.css, instead it tries to load the ProjectName.styles.css which does not exist. (404)
If I use
MapStaticAssets
with the endpoints.json, the status code is 200, but the result is length 0.Background I have multiple blazor WebApp as Razor Class libraries distributed as nuget packages, which are reused multiple times in different main solutions (which are not blazor apps,but usually simple web api apps with rest apis). In .NET 8 times it was already not possible to use "ProjectName.styles.css" logic, but I had to manually reference "ProjectName.bundle.scp.css" and other bundled css (like for quickgrid).
But now with fingerprinting, the bundle has no fixed name anymore. Fingerprinting can be disabled via the rather undocumented csproj setting "StaticWebAssetFingerprintingEnabled" (thanks to @ViRuSTriNiTy who told me that in Discussions https://github.com/dotnet/aspnetcore/discussions/58910), but that does not disable fingerprinting with externally packaged nugets like Quickgrid.
Expected Behavior
The assets are properly loaded, even if the hosting application is not a blazor app, but the Blazor App is packaged as a nuget package.
There is an api/way to reference assets with fingerprinting in razor class libraries or it is properly documented that you still need to reference the un-fingerprinted one, because the endpoint for it exists.
Steps To Reproduce
Notes:
Exceptions (if any)
No response
.NET Version
9.0.100
Anything else?
No response