I have been working on this problem for a while now and was not able to find a solution.
I have a Razor-Project, that has - among other files - a Stylesheet.razor file. It looks like that:
<!-- FontAwesome stylesheets -->
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/UI.Web.Blazor.Components.css" />
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/assets/fontawesome/css/fontawesome.css" />
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/assets/fontawesome/css/duotone.css" />
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/assets/fontawesome/css/solid.css" />
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/assets/fontawesome/css/brands.css" />
<!-- Telerik scripts -->
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>
<!-- Custom custom Telerik theme -->
<link rel="stylesheet" href="_content/UI.Web.Blazor.Components/telerik-ui.css" />
The files that are references here are all in the wwwroot-Folder: For example the first href="_content/UI.Web.Blazor.Components/UI.Web.Blazor.Components.css"-File can be found in wwwroot
Then I have a .nuspec file in that same projekt:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>UI.Web.Blazor.Components</id>
<version>1</version>
<authors>Me</authors>
<description>A Blazor Component package</description>
<dependencies>
<group targetFramework="net8.0">
<dependency id="Microsoft.AspNetCore.Components.Web" version="8.0.0" />
<dependency id="Microsoft.Extensions.DependencyInjection" version="8.0.0" />
<dependency id="Microsoft.Extensions.Localization" version="6.0.7" />
<dependency id="Telerik.UI.for.Blazor" version="5.0.1" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin\Release\net8.0\UI.Web.Blazor.Components.dll" target="lib\net8.0" />
</files>
</package>
I'm able to build the project and also pack it to a nuget package. So far so good.
But when I include this new package into my other project, where I want to consume it, I get 404-NotFound-Errors for all the files mentioned in the Stylesheet.razor - except the script telerik-blazor.js. That one is from another nuget package and they seem to do it right.
What am I doing wrong? I tried following nuspec changes:
- Including the files via
contentFiles-Tag - Including the files in the
files-Tag