1

I'm making a library, and creating a nuget package using the nuget spec and nuget pack commands. However, every time I run nuget spec, I get a load of rubbish in the .nuspec file that I don't want (like 'SampleDependency') I was wondering if it's possible to add these values (Id, URL, etc.) via command line switches. From what I can see on the documentation, it's not possible, but I don't know if it's been left out or something similar. Also, if it isn't possible, how would I edit the .nuspec file in a batch to give it the values I want?

TechnicalTophat
  • 1,655
  • 1
  • 15
  • 37

1 Answers1

1

To your question around command-line switches. There are no commands to pass in the values you want. If you are packing a csproj instead of an assembly, you do get replacement token support and automatic dependency generation.

If you want to pack assemblies, you should be able write your own batch/powershell scripts to make the changes you need. Easiest thing would be a generate a nuspec, create replacement tokens (E.g $id$ for ID) for the fields you want to change and a do a replace before pack.This way you can create the nuspec file once, set it up and then substitute the values on each pack.