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

两盒软妹~` 提交于 2020-12-30 07:35:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!