I have a nuget package in which I have an xml file, say, config.xml
. I want this file to be copied to the bin
folder of any dependent project. However, regardless of how I try to specify this file or where I put it based on various guides I've found, I can't manage to get it copied.
If I rename my .nupkg
to *.nupkg.zip
and look at it in explorer, it has the following internal structure:
package root
|-- lib
| +-- net45
| |-- My.Own.Library.dll
| +-- My.Own.Library.xml
+-- config.xml
When I build the dependent project, I get something like this in my bin folder:
bin
|-- My.Own.Program.exe
|-- My.Own.Library.dll
+-- My.Own.Library.xml
Note that config.xml
isn't included here. How do I, preferrably from the nuget specification of the package (rather than in the dependent project) make sure that config.xml
is copied into the bin
folder when the program is built?
Some additional info:
I have in the project.json
file of the library which generates the nuget packge, the following specification:
"packInclude": {
"/": "config.xml",
"lib/net45/": "config.xml"
},
"contentFiles": [
"config.xml"
],
However, this doesn't seem to generate anything in the .nuspec
file that is included in the package in the output folder. I found these instructions, and edited the generated .nuspec
manually to match:
<contentFiles>
<files include="contentFiles/any/any/certificates.xml" copyToOutput="true" />
</contentFiles>
This didn't have any effect at all in the dependent project.