Compartilhar via


BuildRequestDataFlags Enum

Definition

Flags providing additional control over the build request

This enumeration supports a bitwise combination of its member values.

public enum class BuildRequestDataFlags
[System.Flags]
public enum BuildRequestDataFlags
[<System.Flags>]
type BuildRequestDataFlags = 
Public Enum BuildRequestDataFlags
Inheritance
BuildRequestDataFlags
Attributes

Fields

Name Value Description
None 0

No flags.

ReplaceExistingProjectInstance 1

When this flag is present, the existing ProjectInstance in the build will be replaced by this one.

ProvideProjectStateAfterBuild 2

When this flag is present, the BuildResult issued in response to this request will include ProjectStateAfterBuild.

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, we will ignore the project state (but not target results) that were previously generated.

ClearCachesAfterBuild 8

When this flag is present, caches including the Microsoft.Build.Evaluation.ProjectRootElementCacheBase will be cleared after the build request completes. This is used when the build request is known to modify a lot of state such as restoring packages or generating parts of the import graph.

SkipNonexistentTargets 16

When this flag is present, the top level target(s) in the build request will be skipped if those targets are not defined in the Project to build. This only applies to this build request (if another target calls the "missing target" at any other point this will still result in an error).

ProvideSubsetOfStateAfterBuild 32

When this flag is present, the BuildResult issued in response to this request will include a ProjectStateAfterBuild that includes ONLY the explicitly-requested properties, items, and metadata.

IgnoreMissingEmptyAndInvalidImports 64

When this flag is present, projects loaded during build will ignore missing imports (IgnoreMissingImports and IgnoreInvalidImports). This is especially useful during a restore since some imports might come from packages that haven't been restored yet.

FailOnUnresolvedSdk 128

When this flag is present, an unresolved MSBuild project SDK will fail the build. This flag is used to change the IgnoreMissingEmptyAndInvalidImports behavior to still fail when an SDK is missing because those are more fatal.

Remarks

The 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. 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.

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.

Applies to