How can I build everything using MSBuild from the command line?

It's really?

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 specify them when calling MSBuild, all sln / proj files have this information. I do not want to change my build script if I add configurations to project files.

So, for the purpose, I can use BuildAll. If I leave the configuration empty, will it build everything or will it be โ€œBuildALLโ€, which is also suitable for the configuration?

EDIT

basically what I am asking is a SLN or VCProj file is provided, I want msbuild to iterate through all the configurations and build it myself, or, alternatively, some mechanism that will detect them, so I donโ€™t need to list them specifically in command line or script.

i.e. I do not want to update my build script when adding or removing configuration. This seems like a pretty reasonable thing you want to do.

+4
source share
1 answer

By default, you cannot create all configurations using the MSBuild command-line options. To do this, you need to create a new goal (VS project).

How do i do this:

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

I make a standard Target and call it BuildAll, and for every project that I want to automate, I would just create this Target and depend on all the goals that you want to build automatically.

+7
source

All Articles