[error]error MSB8020: The build tools for v140 (Platform Toolset = ‘v140’) cannot be found.

Error Detail

error MSB8020: The build tools for v140 (Platform Toolset = ‘v140’) cannot be found. To build using the v140 build tools, please install v140 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”.

Cause

The required version of build tool for building solution is different from the version of build tool on your environment.

Checklist

Retarget the solution. Right click on the solution and click the “Retarget solution”. Select the version of build tool required.