0

Is there a way to specify which projects in a Visual Studio Project File (.sln) are built? I want to build only certain projects based on an input to a script, but I don't want to run multiple seperate builds from different .slns, I want to have it contained in a single /build command.

Ie. if I have

Project
    ...a
    ...
EndProject
Project
    ...b
    ...
EndProject
Project
    ...c
    ...
EndProject
..
..

Is there a way to only have a subset of projects a,b,c be built depending on the /build command I use?

ddnm
  • 187
  • 1
  • 10

1 Answers1

1

Yes. Create a solution configuration for each set of projects you'd like to build as a group. Make sure only those projects you actually want built have their "Build" option checked in the Configuration Manager for that solution configuration.

enter image description here

Pass /p:Configuration=... on the command line to MSBuild to build that configuration (and thus that set of projects).

Cameron
  • 96,106
  • 25
  • 196
  • 225