首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误MSB8052: MSVC工具集版本'14.28.29333‘与'v120’平台工具集不兼容

错误MSB8052: MSVC工具集版本'14.28.29333‘与'v120’平台工具集不兼容
EN

Stack Overflow用户
提问于 2021-04-26 15:32:41
回答 1查看 267关注 0票数 1

我一直面临这个问题很久了,我正在尝试在VS 2019中构建一个项目,这个项目之前在vs 2013中构建得很好。我正面临着这个错误,它在Microsoft论坛上没有任何定义。

我已经尝试了使用2019工具集进行所有的重定目标,并在项目配置文件中将工具集版本更改为当前版本,但都没有成功。

我不确定为什么微软论坛对这个错误代码没有任何解释(error MSB8052)

此外,项目名称前面的括号中仍然显示了visual studio 2013。我已经更改了所有工具集以使用2019版本,但这不会改变。

错误如下:错误MSB8052: MSVC工具集版本'14.28.29333‘与'v120’平台工具集不兼容。请将平台工具集更改为v142,或将MSVC工具集版本(VCToolsVersion属性)更改为格式为'12.0*.*‘的版本。要为给定的平台工具集使用默认的MSVC工具集版本,请不要设置VCToolsVersion属性。

我不知道怎么回事,它仍然在使用旧的平台工具集。有人能帮我一下吗?在此处输入代码

代码语言:javascript
运行
复制
<?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>
EN

回答 1

Stack Overflow用户

发布于 2021-04-27 17:45:43

可以直接打开vcxproj文件,确认后将Platform Toolset修改为V142

如果它不工作,你可以尝试删除旁边的.vs文件夹你的sln文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67262540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档