MSBuild .Targets Files

MSBuild includes several .targets files that contain items, properties, targets, and tasks for common scenarios. These files are automatically imported into most Visual Studio project files to simplify maintenance and readability.

Projects typically import one or more .targets files to define their build process. For example a Visual C# project created by Visual Studio will import Microsoft.CSharp.targets which imports Microsoft.Common.targets. The Visual C# project itself will define the items and properties specific to that project, but the standard build rules for a Visual C# project are defined in the imported .targets files.

The $(MSBuildToolsPath) value specifies the path of these common .targets files. If the ToolsVersion is 4.0, the files are in the following location: WindowsInstallationPath\Microsoft.NET\Framework\v4.0.30319\