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

Snippet-packages in .net5

$
0
0

I have some snippet packages like this:

<package><metadata><id>hw.Helper.Core</id>     ...<dependencies><dependency id="JetBrains.Annotations" version="10.2" /></dependencies></metadata><files><file src="hw.Helper.Core\" target="content/hw" /></files></package>

With this the resulting package contains a folder "content" and a subfolder "content/hw" where nuget assembled all files that are located in "${ProjectDir}hw.Helper.Core".This works fine when using those packages in net-frameworks until version 4.x.

With .net5.0-frameworks it seems that the content-folder is just ignored. The documentation states:"Content files are included in a package using the element, specifying the content folder in the target attribute. However, such files are ignored when the package is installed in a project using PackageReference, which instead uses the element."(https://docs.microsoft.com/en-us/nuget/reference/nuspec#including-content-files).

The suggested alternative those not work either. I added to the metadata-section:

<contentFiles><files include="hw.Helper.Core\**" buildAction="Compile"  /></contentFiles>

Nothing happens. (Btw.: I even don't know how to put the snippets into a subdirectory with this variant.)

Is that function really abandoned in .net50?

Are there any working alternatives for snippet-packages?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



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