Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Installing an RCL nuget package with static css files, gives me 404 when consumed

$
0
0

I have tried many of different solutions/suggestions found in here, nothing seems to work. It is probably a minor thing, but I just can't see it

For simplicity, I try only focus on ONE css file in the question.

Once the nuget pack is created from the RCL, I pack it and load it into the Nuget Explorer and get this:

enter image description here

So there are static content. Then I add the nuget package to my Blazor WASM project and edit the index.html file:

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /><base href="/" /><!-- 3. party styles --><link rel="stylesheet" media="screen, print" href="_content/JOSTGO.Blazor.ComponentLibrary.Core/css/bootstrap.min.css" /></head><body class="overflow-hidden"><div id="app" class="vh-100 vw-100 d-flex flex-row">Loading...</div><div id="blazor-error-ui">        An unhandled error has occurred.<a href="" class="reload">Reload</a><a class="dismiss">🗙</a></div><script src="_framework/blazor.webassembly.js"></script></body></html>

This is the error I get:

enter image description here

I have not added the builder.WebHost.UseStaticWebAssets() in the host project, in the program file, as some says it is needed, some says it is not. But I have tried it and it made no difference.

I also created a RCL project in the solution to test, where I added a single CSS file. It worked fine.

Let me know if you need more info.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>