MSBuild error MSB8020
This article describes the MSB8020 error message.
Message text
MSB8020: The build tools for *toolset-name* (Platform Toolset = '*platform-toolset*') cannot be found. To build using the *platform-toolset* build tools, please install *toolset-name* build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Remarks
A platform toolset is a collection of build tools for a particular version of Microsoft C++ (MSVC) and target platform.
For C++ projects, the $(PlatformToolset)
property (for example, v143) points to a folder in VS install, which contains MSBuild .props
and .targets
files that support a particular build toolset, see Add a new platform toolset.
If this folder does not exist, the MSB8020 error occurs.
Resolution
The native tools are architecture-specific and need to be installed for each platform ($(Platform)
), which represents the target architecture. For instance, for Windows Desktop ARM64 support, you need to install MSVC ARM64 components found in the individual components. See Modify Visual Studio.
For Universal Windows Platform (UWP) projects (that is, projects which have $(ApplicationType)
set as "Windows Store"), a specific UWP MSVC version (v143, v142, and so on) should be installed as a part of UWP workflow, which is an optional component. If you only install desktop MSVC support, but not the UWP component, this error occurs when you try to build a UWP project. Each UWP MSVC toolset includes support for all target architectures.
The missing platform toolset can also come from a Visual Studio extension (see Visual Studio C++ Project system extensibility and toolset integration). In this case, search for the name of the toolset in the Visual Studio extension gallery and install it from there.