Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
BuildProjectFile Method (String, String[], BuildPropertyGroup, IDictionary, BuildSettings, String)

Engine.BuildProjectFile Method (String, String[], BuildPropertyGroup, IDictionary, BuildSettings, String)

Loads a project file from disk and builds the given targets.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.BuildEngine
Assembly:  Microsoft.Build.Engine (in Microsoft.Build.Engine.dll)

public bool BuildProjectFile(
	string projectFile,
	string[] targetNames,
	BuildPropertyGroup globalProperties,
	IDictionary targetOutputs,
	BuildSettings buildFlags,
	string toolsVersion
)

Parameters

projectFile
Type: System.String

The name of the project to build.

targetNames
Type: System.String[]

A BuildPropertyGroup array of targets for each project. Can be null if you want to build the default targets for the project.

globalProperties
Type: Microsoft.Build.BuildEngine.BuildPropertyGroup

An IDictionary array of properties for each project. Can be null if no global properties are required.

targetOutputs
Type: System.Collections.IDictionary

A BuildSettings array of tables for target outputs. Can be null if outputs are not required.

buildFlags
Type: Microsoft.Build.BuildEngine.BuildSettings

A string array of additional build flags.

toolsVersion
Type: System.String

The ToolsVersion to impose on the project in this build.

Return Value

Type: System.Boolean
true if the build succeeds; otherwise, false.

This overload takes a set of global properties for each project to use for the build, returns the target outputs, and also enables the caller to specify additional build flags.

Show:
© 2015 Microsoft