The build tools for v143 (Platform Toolset = 'v143') cannot be found
I am upgrading my application build environment from Visual Studio 2019 to Visual Studio 2022. I have installed and setup the Visual Studio 2022 Professional
As VS2019 uses Platform toolset v142 while VS2022 uses platform toolset v143, I will have to change platform toolset of all the projects (around 400 projects) in my application. So instead, I am using Directory.build.targets (placed in the root directory) file to overwrite the platform toolset in all my project files
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Label="Globals">
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
</Project>
But when building projects I am facing this issue. I am sure I have installed all the v143 build related tools from Visual Studio Installer (shown in above images).
error MSB8020: The build tools for v143 (Platform Toolset = 'v143') cannot be found. To build using the v143 build tools, please install v143 build tools.
When I am removing the Directory.build.targets file and manually changing the project file from <PlatformToolset>v142</PlatformToolset>
to <PlatformToolset>v143</PlatformToolset>
its working fine.
What can be the issue ??