Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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)
Syntax
'Declaration
Public Function BuildProjectFile ( _
    projectFile As String, _
    targetNames As String(), _
    globalProperties As BuildPropertyGroup, _
    targetOutputs As IDictionary, _
    buildFlags As BuildSettings, _
    toolsVersion As String _
) As Boolean
public bool BuildProjectFile(
    string projectFile,
    string[] targetNames,
    BuildPropertyGroup globalProperties,
    IDictionary targetOutputs,
    BuildSettings buildFlags,
    string toolsVersion
)
public:
bool BuildProjectFile(
    String^ projectFile, 
    array<String^>^ targetNames, 
    BuildPropertyGroup^ globalProperties, 
    IDictionary^ targetOutputs, 
    BuildSettings buildFlags, 
    String^ toolsVersion
)
member BuildProjectFile : 
        projectFile:string * 
        targetNames:string[] * 
        globalProperties:BuildPropertyGroup * 
        targetOutputs:IDictionary * 
        buildFlags:BuildSettings * 
        toolsVersion:string -> bool
public function BuildProjectFile(
    projectFile : String, 
    targetNames : String[], 
    globalProperties : BuildPropertyGroup, 
    targetOutputs : IDictionary, 
    buildFlags : BuildSettings, 
    toolsVersion : String
) : boolean
Parameters
- projectFile 
 Type: System.String- The name of the project to build. 
- targetNames 
 Type: array<System.String[]- A BuildPropertyGroup array of targets for each project. Can be nulla null reference (Nothing in Visual Basic) 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 nulla null reference (Nothing in Visual Basic) if no global properties are required. 
- targetOutputs 
 Type: System.Collections.IDictionary- A BuildSettings array of tables for target outputs. Can be nulla null reference (Nothing in Visual Basic) 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.
Remarks
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.