NuGet package version and NuGet Id

I have one Project.sln on my GitRepo. And I need to build 4 nuget packages with different configurations (local, qa, sandbox and production). I'm using TeamCity with Octopus Deploy.

In TeamCity my Build Configuration have the next Build Steps:

1) NuGet Installer
2) Build Project.sln with *Local* Configuration
3) NuGet Pack with using .csproj file

4) NuGet Installer
5) Build Project.sln with *QA* Configuration
6) NuGet Pack with using .csproj file

7) NuGet Installer
8) Build Project.sln with *Sandbox* Configuration
9) NuGet Pack with using .csproj file

10) NuGet Installer
11) Build Project.sln with *Production* Configuration
12) NuGet Pack with using .csproj file

And I have the next problems:
1) When I'm using AssemblyInfo patcher it make me only one NuGet package file. TeamCity create on step number 3 file with name 2.2.1.%build.counter%. And at step number 6 it make a package with the same name and overwrite it. After that it repeats that situation at steps 9 and 12. Finally I have only one Nuget package with last configuration (In my case it'sProduction).

I wan't to have 4 packages looks like:

2.2.1.%build.counter%_local
2.2.1.%build.counter%_qa
2.2.1.%build.counter%_sandbox
2.2.1.%build.counter%_production

2) The next problem with Octopus. When TeamCity make packages (yes, I'm made 4 packages, but without AssemblyInfo patcher), it make with the same id (Project) and when I'm trying to Deploy "some" (let it be QA) package on QA environment, Octopus ask me to set id of a NuGet package. And it see only one id - "Project". And I think it last package who was maked by TeamCity.

Help me, please!

1 comment

Hi Alexey,

Did you specify "Version" parameter in NuGet Pack build step (it's an advanced option)? You can use it to add different suffixes like -local, -qa and so on.
Also it's not clear how you use AssemblyInfo patcher. This feature is irrelevant to NuGet packages creation. Please provide more details.

0

Please sign in to leave a comment.