I am using Visual Studio Team Services to run builds for a library that I publish as a Nuget package.
The project contains a nuspec file which specifies the name, description, project url and other static info.
This nuspec file is referenced on the Nuget pack build action in VSTS
I would like to include the info about dependencies as well, however, I do not want to manage that manually in the nuspec XML (error prone and time consuming).
The nuspec file does not contain the element, so I hoped VSTS NuGet pack action would include them automatically.
Is there any way to achieve that?
Apparently, quite a simple solution exists.
You can set your VSTS Nuget pack task to use the csproj file (not the nuspec), however it will still access the nuscpec to get the metadata. See the logs below:
To reiterate, instead of setting the pattern for the nuspec file in the build task in VSTS, set the path to the csproj file.