I have a .nuspec file that goes like the one below. In the files section, I'm trying to copy the .nuspec file itself, so when the package is installed, it winds up in a "Components/tst" directory in the target project (so the dependencies information contained in the .nuspec is available in the target project):
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
...
</metadata>
<files>
<file src=".\tst.nuspec" target="content\Components\tst\tst.nuspec" />
<file src="Component\script.js" target="content\Components\tst\script.js" />
<file src="Component\style.less" target="content\Components\tst\style.less" />
</files>
</package>
The problem is that when I create the .nupkg file (using nuget pack), the tst.nuspec file is not copied to the content\Components\tst\tst.dependencies file inside the package. And when I install the package, the tst.nuspec file is not copied to the target project.
The other files in the files section (script.js and style.less) are copied fine.
Is there any way I can persuade nuget pack to copy the .nuspec file itself, along with the other files? If not, what would be the best way to copy the .nuspec file to the target project?