6

Is it possible to have multiple nuspec files inside a single directory for the same project and still be able to merge the project and the specified nuspec file.

I wonder if something like this is possible:

nuget pack MyProject.csproj MyProject-x86.nuspec -prop Configuration=Release;Platform="x86"
nuget pack MyProject.csproj MyProject-AnyCpu.nuspec prop Configuration=Release

I need to be able to publish my project with more than one build configuration and thus I need to create different packages.

My very, very last resort will be to copy the csproj file at build time, rename it to "MyProject-x86.csproj" for example, run the nuget pack and then delete it. I would hate to do that and I am looking for alternatives.

Thanks.

Ivan Zlatanov
  • 5,146
  • 3
  • 29
  • 45

1 Answers1

0

When calling NuGet pack, you cannot pass more than a single csproj or nuspec file. Note the pipe in the command line help (to indicate one or the other):

usage: NuGet pack <nuspec | project> [options]

You could create another csproj stripped down to just an import element to the main csproj (i.e. the one you work from in Visual Studio), override the values of property group items as needed, and/or have matching .nuspec files.

techvice
  • 1,315
  • 1
  • 12
  • 24
GrahamD
  • 184
  • 1
  • 5