相关疑难解决方法(0)

将 c++/cli 项目从 .net 4.7 迁移到 .netcore 3.1 时出现问题

我正在将 wpf .net 4.7 解决方案迁移到 .net core 3.1 我正在使用 Visual Studio 16.6.3。wpf 项目在 .net core 上编译得很好。但依赖的 c++/cli 项目无法编译。我根据此https://learn.microsoft.com/de-de/dotnet/core/porting/cpp-cli更改了 .vcxproject 。vcxproject 现在看起来像:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <VCProjectVersion>16.0</VCProjectVersion>
    <ProjectGuid>...</ProjectGuid>
    <Keyword></Keyword>
    <RootNamespace>XY</RootNamespace>
    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v142</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <CLRSupport>NetCore</CLRSupport>
    <VCToolsVersion>14.26.28801</VCToolsVersion>
  </PropertyGroup>
 
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="Shared">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" …
Run Code Online (Sandbox Code Playgroud)

c# c++ msbuild visual-studio

2
推荐指数
1
解决办法
1995
查看次数

标签 统计

c# ×1

c++ ×1

msbuild ×1

visual-studio ×1