1

I have a custom nuspec file for a c# project. In this example, the project is supposed to produce a nuget package which has an exe and a folder with some extra content in it.

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <metadata>
        <id>$id$</id>
        <version>$version$</version>
        <authors>$authors$</authors>
        <description>$description$</description>
        <contentFiles>
            <files include="Program.exe" buildAction="Content" copyToOutput="true" />
            <files include="Folder/**/*" buildAction="Content" copyToOutput="true" />
        </contentFiles>
    </metadata>


    <files>
        <file src="src\Program.exe" target="contentFiles"/>
        <file src="src\Folder\**\*" target="contentFiles\Folder"/>
    </files>
</package>

When I inspect the .nupkg, the files are all there inside of a contentFiles folder. However when I try and consume the package with a package reference

<PackageReference Include="MyPackage" Version="1.0.0" />

..the files don't actually end up in the output folder. It's probably a small issue but I can't seem to be able to find an answer. Any hints would be great.

SomeDev
  • 11
  • 1
  • Does it work if you use additional `any\any` subfolders for your contentFiles? (convention for langauge and target framework subfolders) – Martin Ullrich Nov 17 '20 at 12:36

0 Answers0