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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With