I want to have a nuspec
file that automatically reads all the info from packages.config
and so on, building up all the dependencies, but also includes just one single additional file.
Is there a way to do this?
For example, here is a nuspec
file that does almost what I want:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata>
<id>My.Project</id>
<version>1.0.0.0</version>
<owners>Me</owners>
<authors>Me</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<title>My.Project</title>
<description>My.Project</description>
<frameworkAssemblies />
<copyright>Copyright © 2015</copyright>
<tags></tags>
</metadata>
</package>
If my project references ten nuget
packages, the above nuspec
file will detect that and add them as dependencies when I pack the package together.
But, the moment I add a files
element then all the auto-linking to my other nuget dependencies stops:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata>
<id>My.Project</id>
<version>1.0.0.0</version>
<owners>Me</owners>
<authors>Me</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<title>My.Project</title>
<description>My.Project</description>
<frameworkAssemblies />
<copyright>Copyright © 2015</copyright>
<tags></tags>
</metadata>
<files>
<file src="myfile.dll" target="lib\net45" />
</files>
</package>
Without the auto-linking I effectively have to maintain two copies of all the dependencies for my project: one in the csproj
file and one here.
There must be a way to do this?! I want to just add a single extra file to my package, via a nuspec.