Search code examples
c#teamcitynuget

When using NuGet Pack is it possible to specify the package name without a nuspec file?


I am trying to create a nuget package for a .csproj file but want the package name to be different from the csroj file (which it is by default) and I don't want to specify a .nuspec file. Is there a way of doing this? I can only see a version name override option on the command line options and not a package name override option.

I am doing this in TeamCity but this is besides the point. I am thinking I need to pass additional parameters to the NuGet pack command?

Thanks,


Solution

  • Nuget command line doesn't provide any option for direct name change. http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command

    If you want to differ project and nuget package name you will have to prepare and edit custom nuspec file. You may also do it manually after creating package by using e.g. NuGetPackage Explorer.