建立无依赖的MSBuild目标 [英] Build MSBuild target without dependencies

查看:69
本文介绍了建立无依赖的MSBuild目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以告诉MSBuild 4.0建立目标,但是忽略任何依赖关系吗?我只想自己建立目标,

Is there any way I can tell MSBuild 4.0 to build a target, but ignore any dependencies? I just want to build that target itself, nothing else.

推荐答案

我想重申@EMP的解决方案(由于我的声誉微不足道,我无法将他投票支持).

I would like to reiterate @EMP's solution (and I can't vote him up due to my puny reputation).

避免MSBuild重建项目文件中列出的所有依赖项的默认行为的正确方法是将BuildProjectReferences属性设置为false.

The correct way to avoid MSBuild's default behavior of rebuilding all the dependencies listed in the project file is to set the BuildProjectReferences property to false.

在他的回答中,他从MSBuild脚本中调用了MSBuild.这是命令行示例:

In his answer he invokes MSBuild from within an MSBuild script; here's an example from the command line:

MSBuild myproj.csproj /p:Configuration=Debug /p:BuildProjectReferences=false /t:Build

这篇关于建立无依赖的MSBuild目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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