Reputation: 2016
I am working on a continuous integration project. I've set up a local nuget package repository as well as setup Atlassian Bamboo (basically msbuild) for builds and deployment. The nuget package versions are as follows:
MyPackage.Library Version 1.1.1.1
MyPackage.Library Version 1.1.1.1-Test
MyPackage.Library Version 1.1.1.1-Dev
The package without the additional name is the production package. Bamboo builds all three and deploys them to the nuget package server fine, but the problem occurs with the projects I intend to use them with. I have not figured out a way to 'transform' packages.config to specify the test or dev nuget packages when bamboo builds the test and dev version of the project I include the packages in. (Sorry if that is confusing).
How can I specify which nuget package to use based on which solution configuration (inside the IDE)?
(EDIT: Right now looking into how the build in visual studio nuget package restore works. I know I can specify a package manually using something like ...
String cmdnuget = "C:\\Tools\\nuget restore " + item.toString() + " -PackagesDirectory " + startingDir.toString() + "\\packages -NonInteractive -NoCache -ConfigFile C:\\Tools\\NuGet.config";
But that doesn't really help out with inside the IDE development and debugging).
EDIT2: Toying with the idea of using an individual git repo for dev / test / prod. This may be the path to choose since the packages.config file can contain the proper mapping to the dev / test packages. I'll leave it open now in case someone has a better idea.
Upvotes: 3
Views: 583
Reputation: 2016
Using an individual repo for each environment and having each one contain the proper packages.config containing the proper nuget packages for each environment was a simple solution to this problem. I honestly asked the wrong question, took the wrong path, then discovered later that a simple approach sometimes works the best.
Upvotes: 1