1

Requirement: We've set of pdf files which should be copied to build directory. We're trying to make a nuget package with these files.

nuspec file used for generating the nuget package:

  `<package>
  <metadata>
    <id>PACKAGE</id>
    <version>1.0.2</version>
    <title></title>
    <authors>AUTHOR</authors>
    <owners>OWNER</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description></description>
    <contentFiles>
        <files include="contentfiles/*.pdf" buildAction="None" copyToOutput="true" />
    </contentFiles> 
  </metadata>
  <files>
    <file src=".\*.pdf" target="contentFiles" />
  </files>
</package>`

Nuget.exe version used for packing: 4.8.1.5435

Methods we tried: Using Install.ps1 & Uninstall.ps1 powershell scripts (Seems like its not supported now) Playing around with buildAction attribute and copyToOutput attribute

** We won't specify these in lib directory since these are plain files which is required in different apps targeting different .net frameworks and .net core.

  • Have you [read the docs on including content files](https://learn.microsoft.com/en-us/nuget/reference/nuspec#including-content-files)? `content`only works with `packages.config`projects, while `contentFiles` only works with `PackageReference` projects. Also, the docs put the files in `contentFiles\any\any\*`, so maybe that's important. – zivkan Dec 23 '18 at 16:05

0 Answers0