After reading all that I can find about the new NuGet 3.3+ contentFiles element, I still can't get it to work in my package. I have a package that targets both net46
and uap10.0
, and choosing the right DLLs for the project type and platform works as expected. But I would also like to add two files to the project for installing the package, one CSV file for all projects and platforms and one code file for C # or VB.Net (with buildAction="Compile"
). Here's a shortened version of my latest .nuspec file:
<?xml version="1.0" encoding="utf-8" ?> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="3.3.0"> ... <contentFiles> <files include="any\any\ErrorCodes.csv" buildAction="None" copyToOutput="false" /> <files include="cs\any\Errors.cs.pp" buildAction="Compile" /> <files include="vb\any\Errors.vb" buildAction="Compile" /> </contentFiles> </metadata> <files> <file src="contentFiles\any\any\ErrorCodes.csv" target="contentFiles\any\any\" /> <file src="contentFiles\cs\any\Errors.cs.pp" target="contentFiles\cs\any\" /> <file src="contentFiles\vb\any\Errors.vb" target="contentFiles\vb\any\" /> ... </files> </package>
The package is created without errors, and it contains three files in the contentFiles folder with the specified directory structure.
But when I install the package - I tried it with both a universal application (C # and VB) and the .NET 4.6 console application, which I modified to use the project.json
file - a link to the DLL was added, but the content files weren’t They are added to the project structure and are not copied to the project directory.
I am grateful for any contribution!
source share