Export (0) Print
Expand All

MSBuild Class

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Implements the MSBuild task. Use the MSBuild element in your project file to create and execute this task. For usage and parameter information, see MSBuild Task.

Namespace:  Microsoft.Build.Tasks
Assembly:  Microsoft.Build.Tasks.v4.0 (in Microsoft.Build.Tasks.v4.0.dll)

[RunInMTAAttribute]
public class MSBuild : TaskExtension

The MSBuild type exposes the following members.

  NameDescription
Public methodMSBuildInfrastructure. Initializes a new instance of the MSBuild class.
Top

  NameDescription
Public propertyBuildEngineGets or sets the instance of the IBuildEngine object used by the task. (Inherited from Task.)
Public propertyBuildEngine2Gets the instance of the IBuildEngine2 object used by the task. (Inherited from Task.)
Public propertyBuildEngine3Gets the instance of the IBuildEngine3 object used by the task. (Inherited from Task.)
Public propertyBuildInParallelInfrastructure. Gets or sets a Boolean value that specifies whether the projects specified in the Projects property are built in parallel, if possible.
Protected propertyHelpKeywordPrefixGets or sets the prefix used to compose Help keywords from resource names. (Inherited from Task.)
Public propertyHostObjectGets or sets the host object associated with the task. (Inherited from Task.)
Public propertyLogInfrastructure. Gets an instance of a TaskLoggingHelperExtension containing task logging methods. (Inherited from TaskExtension.)
Public propertyProjectsInfrastructure. Gets or sets the project files to build.
Public propertyPropertiesInfrastructure. Gets or sets a semicolon-delimited list of property name/value pairs to apply as global properties to the child project.
Public propertyRebaseOutputsInfrastructure. Gets or sets a Boolean value that specifies whether the relative paths of target output items from the built projects have their paths adjusted to be relative to the calling project.
Public propertyRemovePropertiesGets or sets the set of global properties to remove.
Public propertyRunEachTargetSeparatelyInfrastructure. Gets or sets a Boolean value that specifies whether the MSBuild task invokes each target in the list passed to MSBuild one at a time, instead of at the same time.
Public propertySkipNonexistentProjectsInfrastructure. Gets or sets a Boolean value that specifies whether project files that do not exist on the disk will be skipped.
Public propertyStopOnFirstFailureInfrastructure. Gets or sets a Boolean value that specifies whether the task should stop building the remaining projects as soon as any one of them may not work.
Public propertyTargetAndPropertyListSeparatorsInfrastructure. Gets or sets the escape characters to be unescaped from the specified Properties and Targets.
Public propertyTargetOutputsInfrastructure. Returns the outputs of the built targets from all the project files. Only the outputs from the targets that were specified are returned, not any outputs that may exist on targets that those targets depend on.
Public propertyTargetsInfrastructure. Gets or sets the target or targets to build in the project files. Use a semicolon to separate a list of target names.
Protected propertyTaskResourcesGets or sets the culture-specific resources associated with the task. (Inherited from Task.)
Public propertyToolsVersionInfrastructure. Gets or sets a target .NET Framework version to build the project with, which enables an MSBuild task to build a project that targets a different version of the .NET Framework than the one specified in the project. Valid values are 2.0, 3.0 and 3.5.
Public propertyUnloadProjectsOnCompletionInfrastructure. Gets or sets a Boolean value that specifies whether the project will be unloaded once the operation is completed.
Public propertyUseResultsCacheInfrastructure. Gets or sets a Boolean value that indicates whether the MSBuild engine will return the built targets from the cache.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodExecuteInfrastructure. Instructs the MSBuild engine to build one or more project files whose locations are specified by the Projects property. (Overrides Task.Execute().)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This class implements the "MSBuild" task, which hands off child project files to the MSBuild engine to be built.

Marked RunInMTA because there is no reason MSBuild tasks should run on a thread other than that of the RequestBuilder which spawned them.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft