Editare

Partajați prin


MSBuild tasks specific to C++

Tasks provide the code that runs during the build process. When C++ is installed, the following tasks are available, in addition to those that are installed with MSBuild. For more information, see MSBuild (C++) overview.

In addition to the parameters for each task, every task also has the following parameters.

Parameter Description
Condition Optional String parameter.

A Boolean expression that the MSBuild engine uses to determine whether this task will be executed. For information about the conditions that are supported by MSBuild, see Conditions.
ContinueOnError Optional parameter. Can contain one of the following values:

- WarnAndContinue or true. When a task fails, subsequent tasks in the Target element and the build continue to execute, and all errors from the task are treated as warnings
- ErrorAndContinue. When a task fails, subsequent tasks in the Target element and the build continue to execute, and all errors from the task are treated as errors.
- ErrorAndStop or false (default). When a task fails, the remaining tasks in the Target element and the build aren't executed, and the entire Target element and the build are considered to have failed.

Versions of the .NET Framework before 4.5 supported only the true and false values.

For more information, see How to: Ignore errors in tasks.
Title Description
BscMake task Wraps the Microsoft Browse Information Maintenance Utility tool (bscmake.exe).
CL task Wraps the C++ compiler tool (cl.exe).
CPPClean task Deletes the temporary files that MSBuild creates when a C++ project is built.
ClangCompile task Wraps the C++ compiler tool (clang.exe).
CustomBuild task Wraps the C++ compiler tool (cmd.exe).
FXC task Use HLSL shader compilers in the build process.
GetOutOfDateItems Reads old tlogs, writes new tlogs and returns set of items which are not up-to-date. (helper task)
GetOutputFileName Gets output file name for cl and other tools, which allow specifying only output directory or full file name or nothing. (helper task)
LIB task Wraps the Microsoft 32-Bit Library Manager tool (lib.exe).
Link task Wraps the C++ linker tool (link.exe).
MIDL task Wraps the Microsoft Interface Definition Language (MIDL) compiler tool (midl.exe).
MT task Wraps the Microsoft Manifest Tool (mt.exe).
MultiToolTask task No description.
ParallelCustomBuild task Run parallel instances of the CustomBuild task.
RC task Wraps the Microsoft Windows Resource Compiler tool (rc.exe).
SetEnv task Sets or deletes the value of a specified environment variable.
TrackedVCToolTask base class Inherits from VCToolTask.
VCMessage task Logs warning messages and error messages during a build. (Not extendable. Internal use only.)
VCToolTask base class Inherits from ToolTask.
XDCMake task Wraps the XML Documentation tool (xdcmake.exe), which merges XML document comment (.xdc) files into an .xml file.
XSD task Wraps the XML Schema Definition tool (xsd.exe), which generates schema or class files from a source. See note below.
MSBuild reference Describes the elements of the MSBuild system.
Tasks Describes tasks, which are units of code that can be combined to produce a build.
Task writing Describes how to create a task.

Note

Starting in Visual Studio 2017, C++ project support for xsd.exe is deprecated. You can still use the Microsoft.VisualC.CppCodeProvider APIs by manually adding CppCodeProvider.dll to the GAC.