All the projects I work on now have a very simple MSBuild script that allows you to build either Debug or Release, defaulting to Debug for developers. Our CruiseControl configurations build Release. Comes a shared libraries project, which needs to do Debug, Release or both. How can I accomplish this with MSBuild?
Let’s define a property for the default configuration, ie. when no Configuration is specified on the command line.
What if multiple configurations were specified? For example, Debug;Release. We want to transform a single property into an array of task parameters. There’s a brain-twisting way of doing this with MSBuild.
It seems that the above code does nothing, but it creates an item called Configuration that can be specified as input to another target.
Finally, change all the targets that depend on the configuration name accordingly and use %(Configuration.Identity) rather than $(Configuration) in those tasks.