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.
MSBuild is now available as part of the .NET Core SDK and can build .NET Core projects on Windows, macOS, and Linux.
Changed path
MSBuild is now installed in a folder under each version of Visual Studio. For example, C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild. You can also use the following PowerShell module to locate MSBuild: vssetup.powershell.
MSBuild is no longer installed in the Global Assembly Cache. To reference MSBuild programmatically, use NuGet packages.
Changed properties
The following MSBuild properties have been updated due to the new version number.
MSBuildToolsVersionfor this version of the tools is 15.0. The assembly version is 15.1.0.0.MSBuildToolsPathno longer has a fixed location. By default, it is located in the MSBuild\15.0\Bin folder relative to the Visual Studio installation location, but the Visual Studio installation location can be changed at install time.ToolsVersionvalues are no longer set in the registry.The
SDK35ToolsPathandSDK40ToolsPathproperties point to the .NET Framework SDK that's packaged with this version of Visual Studio (for example, 10.0A for the 4.X tools).
Updates
- Project element has a new
SDKattribute. Also theXmlnsattribute is now optional. For more information on theSDKattribute, see How to: Use MSBuild project SDKs, Packages, metapackages, and frameworks and Additions to the csproj format for .NET Core. - Item element outside targets has a new
Updateattribute. Also, the restriction on theRemoveattribute has been eliminated. - Directory.Build.props and Directory.Build.targets are user-defined files that provide customizations to projects under a directory. Directory.Build.props is automatically imported from Microsoft.Common.props unless the property
ImportDirectoryBuildPropsis set tofalse. Directory.Build.targets is automatically imported by Microsoft.Common.targets unless the propertyImportDirectoryBuildTargetsis set tofalse. - Any metadata with a name that doesn't conflict with the current list of attributes can optionally be expressed as an attribute. For more information, see Item element.
New property functions
EnsureTrailingSlashadds a trailing slash to a path if one doesn't already exist.NormalizePathcombines path elements and ensures that the output string has the correct directory separator characters for the current operating system.NormalizeDirectorycombines path elements, ensures a trailing slash, and ensures that the output string has the correct directory separator characters for the current operating system.GetPathOfFileAbovereturns the path of the file immediately preceding this one. It is functionally equivalent to calling<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />