MSBuild Task Reference
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
Tasks provide the code that runs during the build process. The tasks in the following list are included with MSBuild. When Visual C++ is installed, additional tasks are available that are used to build Visual C++ projects. For more information, see Visual C++ Tasks.
In addition to the parameters listed in the topics in this section, each task also has the following parameters:
||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
- ErrorAndStop or false (default). When a task fails, the remaining tasks in the
Versions of the .NET Framework before 4.5 supported only the
For more information, see How to: Ignore Errors in Tasks.
In This Section
AL (Assembly Linker) Task
Creates an assembly with a manifest from one or more files that are either modules or resource files.
Wraps aspnet_compiler.exe, a utility to precompile ASP.NET applications.
Assigns culture identifiers to items.
Accepts a list of configuration strings and assigns them to specified projects.
Accepts a list of files and adds
<TargetPath> attributes if they are not already specified.
Invokes a target in the project file.
Combines the specified paths into a single path.
Converts a relative path or reference into an absolute path.
Copies files to a new location.
Creates a Visual C#-style manifest name from a given .resx file name or other resource.
Populates item collections from the input items, allowing items to be copied from one list to another.
Populates properties from the input values, allowing values to be copied from one property or string to another.
Creates a Visual Basic-style manifest name from a given .resx file name or other resource.
Invokes the Visual C# compiler to produce executables, dynamic-link libraries, or code modules.
Deletes the specified files.
Stops a build and logs an error based on an evaluated conditional statement.
Runs the specified program or command with the specified arguments.
Finds the app.config file, if any, in the provided lists.
Finds an item in a specified list that has the matching itemspec.
Determines which items in the specified item collection exist in the specified folder and all of its subfolders.
Converts a URL to a correct URL format.
Appends the revision number to the version number.
Generates a ClickOnce application manifest or a native manifest.
Provides an automated way to detect, download, and install an application and its prerequisites.
Generates a ClickOnce deployment manifest.
Converts .txt and .resx files to common language runtime binary .resources files.
Generates the application trust from the base manifest, and from the
Retrieves the assembly identities from the specified files and outputs the identity information.
Retrieves the path to the .NET Framework assemblies.
Retrieves the path to the Windows Software Development Kit (SDK).
Returns the reference assembly paths of the various frameworks.
Generates a .license file from a .licx file.
Creates directories and, if necessary, any parent directories.
Logs a message during a build.
Moves files to a new location.
Builds MSBuild projects from another MSBuild project.
Reads a list of items from a text file.
Reads the metadata within the specified assembly and adds the necessary entries to the registry.
Removes the specified directories and all of its files and subdirectories.
Removes duplicate items from the specified item collection.
Determines whether the application requires the .NET Framework 3.5 SP1.
Obsolete. Use the GenerateResource Task task to convert .txt and .resx files to and from common language runtime binary .resources files.
Determines all assemblies that depend on the specified assemblies.
Takes a list of one or more type library names or .tlb files and resolves those type libraries to locations on disk.
Determines the strong name key source
Resolves the following items in the build process to files for manifest generation: built items, dependencies, satellites, content, debug symbols, and documentation.
Resolves native references.
Determines the output files for non-MSBuild project references.
Creates an XML serialization assembly for types in the specified assembly.
Signs the specified file using the specified certificate.
Sets the access and modification times of files.
Unregisters the specified assemblies for COM interop purposes.
Updates selected properties in a manifest and resigns.
Invokes the Visual Basic compiler to produce executables, dynamic-link libraries, or code modules..
Logs a warning during a build based on an evaluated conditional statement.
Generates a temporary code file by using the specified generated code fragment. Does not delete the file.
Writes the specified items to the specified text file.
Returns values as specified by XPath query from an XML file.
Sets values as specified by an XPath query into an XML file.
Transforms an XML input by using an Extensible Stylesheet Language Transformation (XSLT) or compiled XSLT and outputs to an output device or a file.