Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to exclude project/s from solution in VS using command-line?

I have a solution contains 10 projects and would like to exclude 1 or 2 projects when building the solution. The issue is that I'm building the solution in command line and would like to run it once partially (not all projects) and the next time it should run as is - all projects will be built. (I'm using MSBuild.exe)

Does any of you know of such a way to do it using command line (and not using VS interface)?

Are there any command line arguments to exclude these projects?

like image 644
ShaiO Avatar asked Oct 10 '17 12:10

ShaiO


1 Answers

You can use the /target or /t switch to specify which solutions you want to build.

For example to build two projects "WebApps\MyWebApp.vcproj" and "WebServices\MyWebService.vcproj" you can do:

msbuild.exe Solution.sln /t:WebApps\MyWebApp.vcproj:Build;WebServices\MyWebService.vcproj

Therefore to exclude 2 of 10 projects, you simply list the 8 you wish to build.

like image 109
Ben Avatar answered Oct 23 '22 17:10

Ben