I have the following commands in the post-build event of my VS project to automatically create my .nuspec file, then create my .nupkg file, and then post it to our local repository:
nuget spec $(ProjectName)
nuget pack "$(ProjectDir)$(ProjectName).nuspec"
This works great, creates my .nuspec in my bin directory, I move it to the project level, and then create (pack) my nuget package, and then move it to our local repository.
However, when I create my nuspec this way, it automatically enters the following "extra" lines of code into my .nuspec file (regardless of whether it is the first-time build or not):
<dependency id="SampleDependency" version="1.0" />
This causes problems when I then try and pull this package into another project, as it states that I do not have the dependent package already installed.
What is very odd though, is that if I run nuget spec from the command-line in the project directory ... it does NOT create the
<dependencies> tags in the .nuspec file.
So, my question is ... why does running "nuget spec" automatically in the post-build event create the
<dependencies> tag, and running it manually from the command-line not?
And how do I get around this? I do not want to have the
<dependenies> tags unless they are actually relevant.
Any thanks would be greatly appreciated. Thank You.