BuildRequestDataFlags 枚举


用于提供对生成请求的附加控制的标志。Flags providing additional control over the build request.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class BuildRequestDataFlags
public enum BuildRequestDataFlags
type BuildRequestDataFlags = 
Public Enum BuildRequestDataFlags


IgnoreExistingProjectState 4

在此标志存在时,该项在关联与关联不兼容的节点前生成此请求要求,此生成请求忽略以前生成的项目状态(但不是目标结果)。When this flag is present and the project has previously been built on a node whose affinity is incompatible with the affinity this request requires, this build request ignores the project state (but not the target results) that was previously generated. 通常不希望出现这种行为;有关详细信息,请参阅注解部分。This behavior is not usually desired; see the Remarks section for more information.

None 0

无标志。No flags.

ProvideProjectStateAfterBuild 2

当此标志显示时,为响应此请求发布的 BuildResult 将包括 ProjectStateAfterBuildWhen this flag is present, BuildResult issued in response to this request will include ProjectStateAfterBuild.

ReplaceExistingProjectInstance 1

当存在此标志时,此标志将替换生成中的现有 ProjectInstance。When this flag is present, the existing ProjectInstance in the build will be replaced by this one.


仅当客户端知道新的生成请求不依赖于先前请求生成的项目状态时, 才提供标志。IgnoreExistingProjectStateThe IgnoreExistingProjectState flag is provided only for those cases where the client knows that the new build request does not depend on the project state generated by a previous request. 在不兼容节点关联的情况下, 设置此标志可以提高性能, 因为 MSBuild 需要将项目状态从一个节点序列化到另一个节点。Setting this flag can provide a performance boost in the case of incompatible node affinities, because MSBuild would otherwise have to serialize the project state from one node to another. 序列化项目状态可能会消耗大量资源, 具体取决于项目以前生成的数据量。Serializing the project state can be expensive, depending on the amount of data the project has previously generated.

IgnoreExistingProjectState标志对目标结果不起作用, 因此, 如果上一个请求已生成目标, 则新请求将不会重新生成目标。The IgnoreExistingProjectState flag has no effect on target results, so if a previous request has built a target, the new request will not rebuild the target. 此外, 由于先前生成目标而发生的任何项目状态突变都将重新应用。Additionally, none of the project state mutations which occurred as a consequence of previously building that target will be reapplied.