简体   繁体   中英

error MSB8052: MSVC Toolset Version '14.28.29333' is not compatible with 'v120' Platform Toolset

I have been facing this issue since long, I am trying to build a project in VS 2019 which has previously built fine in vs 2013. I am facing this error which has no definition anywhere on Microsoft forums.

I have tried doing all the retargeting with the 2019 toolset as well as changing the toolset version to current in the project configuration file with no success at all.

I am not sure why even microsoft forums doesnot have any explanation for this error code (error MSB8052)

Also, the project still shows visual studio 2013 written in brackets in front of the project name. I have changed all the toolset to use the 2019 version but this is not changing.

The error is as follows: error MSB8052: MSVC Toolset Version '14.28.29333' is not compatible with 'v120' Platform Toolset. Please either change Platform Toolset to v142 or MSVC Toolset Version (VCToolsVersion property) to the version with the format '12.0*.*'. To use default MSVC Toolset Version for a given Platform Toolset don't set VCToolsVersion property.

I don't know somehow, it is still using the old platform toolset. Can somebody help me with this? enter code here

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Matrix">
    <MatrixProjectDir>..\..\..</MatrixProjectDir>
  </PropertyGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{173A4A3E-C861-4013-9366-08716BF7BCCD}</ProjectGuid>
    <RootNamespace>LogicNpcUnmanagedSupport</RootNamespace>
    <SccProjectName>SAK</SccProjectName>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <SccProvider>SAK</SccProvider>
    <Keyword>Win32Proj</Keyword>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <UseOfMfc>Dynamic</UseOfMfc>
    <CharacterSet>Unicode</CharacterSet>
    <PlatformToolset>v142</PlatformToolset>
    <CLRSupport>true</CLRSupport>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <UseOfMfc>Dynamic</UseOfMfc>
    <CharacterSet>Unicode</CharacterSet>
    <PlatformToolset>v142</PlatformToolset>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="..\..\..\Build\PropertySheets\MatrixReleaseSettings.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="..\..\..\Build\PropertySheets\MatrixDebugSettings.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <RunCodeAnalysis>true</RunCodeAnalysis>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <AdditionalIncludeDirectories>..\Include;$(ProjectDir)\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_COMPILING_NPC_LIB_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <Lib>
      <OutputFile>$(OutDir)ag$(ProjectName).lib</OutputFile>
      <TargetMachine>MachineX64</TargetMachine>
    </Lib>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <AdditionalIncludeDirectories>..\Include;$(ProjectDir)\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_COMPILING_NPC_LIB_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Lib>
      <OutputFile>$(Configuration)\ag$(ProjectName).lib</OutputFile>
      <TargetMachine>MachineX64</TargetMachine>
    </Lib>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="agGuid.cpp" />
    <ClCompile Include="agLogicNpcBuffer.cpp" />
    <ClCompile Include="agLogicNpcCallForwarder.cpp" />
    <ClCompile Include="agLogicNpcClient.cpp" />
    <ClCompile Include="agLogicNpcDispatcher.cpp" />
    <ClCompile Include="agLogicNpcException.cpp" />
    <ClCompile Include="agLogicNpcHeader.cpp" />
    <ClCompile Include="agLogicNpcServer.cpp" />
    <ClCompile Include="stdafx.cpp">
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="agArrayWrapper.h" />
    <ClInclude Include="agArrayWrapperComposite.h" />
    <ClInclude Include="agArrayWrapperPrimitive.h" />
    <ClInclude Include="agGuid.h" />
    <ClInclude Include="agLogicNpcBuffer.h" />
    <ClInclude Include="agLogicNpcCallForwarder.h" />
    <ClInclude Include="agLogicNpcClient.h" />
    <ClInclude Include="agLogicNpcContentFlags.h" />
    <ClInclude Include="agLogicNpcDispatcher.h" />
    <ClInclude Include="agLogicNpcException.h" />
    <ClInclude Include="agLogicNpcHeader.h" />
    <ClInclude Include="agLogicNpcServer.h" />
    <ClInclude Include="agLogicNpcServerInfo.h" />
    <ClInclude Include="agLogicNpcTransport.h" />
    <ClInclude Include="stdafx.h" />
    <ClInclude Include="targetver.h" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

enter code here -  MatrixDebugSettings.props
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
    <Import Project="MatrixBaseSettings.props" />
    <Import Project="MatrixMultiProcessorOptionSetting.props" />
    <Import Project="MatrixDebugBaseSettings.props" />
  </ImportGroup>
  <PropertyGroup>
    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
  </PropertyGroup>
</Project>

enter code here - Microsoft.Cpp.x64.user.props
<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>

You can directly open vcxproj file, then confirm and modify Platform Toolset to V142 在此处输入图像描述

If it doesn't work, you could try to delete.vs folder which is next to your sln file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM