TeamCity NuGet package build for different .NET Frameworks
<p>I've been doing updates to .NET Framework targeted versions of projects updating to latest .NET (4.6.2).</p>

<p>Some of these projects are NuGet packages, built in TeamCity 9.0.2.</p>

<p>I've use the steps in <a href="http://shazwazza.com/post/multi-targeting-a-single-net-project-to-build-for-different-framework-versions/" rel="nofollow">this</a> guide to create multiple build configurations for different .NET Framework version as some of the projects I haven't updated to 4.6.2 reference the NuGet packages. So I am trying to get TeamCity to use these build configurations to output the various Net40, Net45, Net46 and Net462 versions so that I have full compatibility without forcing the need to upgrade all projects that use the NuGet when updating the packages.</p>

<p>I really can't figure out how to do this in TeamCity. I am fairly sure that this should be done in the "Build Steps" configuration, but so far I've not managed to get this to work.</p>

<p><a href="https://i.stack.imgur.com/EQtlI.png" rel="nofollow"><img src="https://i.stack.imgur.com/EQtlI.png" alt="Current Build Steps"></a></p>

<p>So one thing I've tried, which I think I need to do but am not sure is duplicate the first build step and set the <code>Configuration</code> to <code>Release-Net46</code>. I think this is necessary otherwise this version of the assembly wouldn't be built (please correct me if I'm wrong about that!)</p>

<p>The second thing I've tried is to duplicate the <code>NuGet Pack</code> step and in <code>Properties</code> set <code>Configuration=Release-Net46</code> but all that did was replace the Net462 version with Net46 and not include both in the artifacts like I'd hoped.</p>

<p>I also tried in the <code>Properties</code> of <code>NuGet Pack</code> to have multiple <code>Configuration</code> elements like <code>Configuration=Release;Configuration=Release-Net46</code> or <code>Configuration=Release,Release-Net46</code> but both of those resulted in the build failing altogether so clearly that's not the answer.</p>

<p><a href="https://i.stack.imgur.com/3nnYM.png" rel="nofollow"><img src="https://i.stack.imgur.com/3nnYM.png" alt="NuGet Pack Properties"></a></p>

<p>I think there must be a way to get this <code>NuGet Pack</code> build step to pick up the output from the other build configurations and output all available versions of the assembly to the artifacts.</p>

<p>Is that possible? I had thought about creating separate projects for each build configuration in TeamCity but I'm unsure if that's the correct way or it that would cause issues with the package feed and it would seem untidy to duplicate the project four times for each .NET Framework version.</p>