7

Okay, I've been searching around for this answer for a while and, although I've gotten closer, I still don't have an all-encompassing solution.

I've got a library that I'm writing that needs to build for both .NET 4.0 and 4.5. I want to take both of the outputs and combine them into a single NuGet package.

Using these links:

http://shazwazza.com/post/multi-targeting-a-single-net-project-to-build-for-different-framework-versions/

http://brian-federici.com/blog/2013/4/17/automatically-target-multiple-frameworks-in-your-nuget-package

I've managed to get multiple configuration options for handling both Debug/Release and 4.0/4.5 combinations. Also, through Batch Build, I can get multiple configurations to compile at the same time. I have also been able to get NuGet to fire off for the pack and push operations by overriding the AfterBuild target.

However, NuGet fires off after building each configuration, but I want it to fire off only once - after the last build in the batch. That way, it has all the files built that it needs to be able to create a complete package.

Any assistance would be greatly appreciated.

Rich G
  • 93
  • 1
  • 4
  • Take a look at my question/answers [here](http://stackoverflow.com/questions/15816094/is-there-a-recommended-approach-to-configuring-a-nuget-package-targeting-multipl/16066685#16066685). – David Peden Mar 25 '15 at 17:39
  • David Peden: Forgive me if this is a dumb question; but, it looks like the options you posted in the link require the use of a TFS Build Server. Is that correct? – Rich G Mar 25 '15 at 18:17
  • 1
    I happen to use TeamCity but conceptually, TeamCity is simply orchestrating MSBuild and NuGet calls. Nothing that cannot also be done with a batch file or PowerShell. – David Peden Mar 25 '15 at 18:46
  • the question that I linked have the answer (in the question ;)). Requires Visual Studio 2017 – jgauffin Aug 17 '17 at 14:25

0 Answers0