构建没有依赖项的 MSBuild 目标 [英] Build MSBuild target without dependencies

查看:22
本文介绍了构建没有依赖项的 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天全站免登陆