有没有办法使用命令行从 VS 中的解决方案中排除项目? [英] Is there a way to exclude project/s from solution in VS using command-line?

查看:58
本文介绍了有没有办法使用命令行从 VS 中的解决方案中排除项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 10 个项目的解决方案,并希望在构建解决方案时排除 1 或 2 个项目.问题是我正在命令行中构建解决方案并希望部分运行它一次(不是所有项目),下次它应该按原样运行 - 将构建所有项目.(我使用的是 MSBuild.exe)

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)

你们中有人知道这样一种使用命令行(而不是使用 VS 界面)的方法吗?

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?

推荐答案

您可以使用 /target/t 开关来指定要构建的解决方案.

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

例如要构建两个项目WebApps\MyWebApp.vcproj"和WebServices\MyWebService.vcproj",你可以这样做:

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

因此要排除 10 个项目中的 2 个,您只需列出您希望构建的 8 个.

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

这篇关于有没有办法使用命令行从 VS 中的解决方案中排除项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆