您可以从运行生成事件prevent MSBuild.exe? [英] Can you prevent MSBuild.exe from running Build Events?

查看:256
本文介绍了您可以从运行生成事件prevent MSBuild.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过脚本建设一批项目,和偶尔使用自定义生成事件造成困难的构建系统的很大。如果可能的话,我想调用MSBuild.exe在这样一个被以阻挡任何构建事件的执行。从长远来看,这不是构建自动化的一个问题 - 与构建活动的项目提交者是预先警告,这种snafuery是违反规则的。

I'm building a number of projects via a script, and the occasional use of custom build events causes a great deal of difficulty for the build system. If it is possible, I'd like to invoke MSBuild.exe in such a was as to block the execution of any build events. In the long run, this is not an issue for build automation - submitters of projects with build events are forewarned that such snafuery is against the rules.

在短,有没有办法来调用的MSBuild将prevent任何自定义的执行生成步骤,如果present?

In short, is there a way to call MSBuild that will prevent the execution of any custom build steps, if present?

更新:

我倒是认为做项目文件就地(自动)编辑,但将preFER命令行相当于设置排除从生成(见生成事件选项)来是为每个的三个事件。

I'd considered doing an in-place (automated) edit of the project files, but would prefer the command-line equivalent of setting "Excluded From Build" (see the Build Events options) to Yes for each of the three events.

推荐答案

pre / PostBuildEvents是属性,所以要覆盖它们刚刚从命令行设置他们空字符串。

Pre/PostBuildEvents are properties, so to override them just set them from command line to empty string.

msbuild foo.sln /p:PreBuildEvent= /p:PostBuildEvent=

这篇关于您可以从运行生成事件prevent MSBuild.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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