问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/46666573/is-there-a-way-to-exclude-project-s-from-solution-in-vs-using-command-line