8

Is this valid?

MSBuild /t=all /configuration=all

I want to build ALL configurations of all projects in a sln file, etc from the command line using MSBuild in Visual Studio 2008.

I do not want to have to specify them when I call MSBuild, the sln/proj files all have that information. I don't want to change my build script if I add configurations to project files.

So for the target I can use BuildAll. If I leave the configuration empty will it build all or is "BuildALL" valid for configuration as well?

EDIT

essentially what I am asking is given an SLN or VCProj file, I want msbuild to iterate all configurations and build it itself, or alternatively some mechanism that will discover them so I don't have to specifically list them on the command line or in a script.

i.e. I don't want to update my build script when I add or remove a configuration. That seems like a pretty reasonable thing to want to do.

Tim
  • 20,184
  • 24
  • 117
  • 214
  • 2
    Understand about not wanting to have to update the build script every time you add a configuration, but realistically; how many times do you do that? I'd just write a target that calls all of the targets you need. – John Weldon May 09 '09 at 05:14
  • 1
    The other issue is I want to just use the same command/batch file and give it all of the sln files I have. I want to use the same batch file for all of them. I am lazy - I don't want to have to type all those out. – Tim May 09 '09 at 05:54

1 Answers1

13

You can't by default build all configurations using MSBuild command line options. In order to do this you need to create a new target (VS Project).

The way I do it is:

msbuild /t:BuildAll /p:Configuration:"Debug;Release;ContinuousIntegration"

I make a standard Target, and call it BuildAll, and for every project I wanted to automate, I'd just create that Target and make it depend on all the targets you want to build automatically.

John Weldon
  • 39,849
  • 11
  • 94
  • 127