Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Including files from NuGet into my project

$
0
0

I have a NuGet wrapping a Razor Library (RCL), with .NET 7, that has images under wwwroot and SCSS files on a root folder called Scss. I am referencing this NuGet from my Blazor Webassembly 7. I can reference the images from my NuGet using the _content prefix and this is working as expected.

In my Blazor project, I have WebCompiler that will take some local SCSS files and combine them with the ones coming from the NuGet under the Scss folder to form CSS.

I am unable to get the Scss from NuGet to be copied to my Blazor project, I am getting a link to the files in C:\Users\[username]\.nuget\packages\myprojecttheme\1.0.0 instead.

Below is my NuSpec file:

<?xml version="1.0"?><package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MyProjectTheme</id><version>1.0.0</version></metadata><files><file src="wwwroot\**" target="content\" /><file src="Scss\**" target="contentFiles\any\any\Scss\" copyToOutput="true" /></files></package>

How can I have the actual files from the Scss folder being copied to my project rather than a link to them?

I am thinking of copying the files in a post build, but I am looking for a built in NuGet behavior.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



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