简体   繁体   中英

migrate .net core 2.2 to 3.1 issue

After installing .NET core SDK 3.1 and upgrading all my projects' SDK [in my solution] from .NET core SDK 2.2 to 3.1, and updating all packages such as extension to 3.1 version, I successfully built all projects in my solution.

But then I got this error:

C:\Program Files\do.net\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): C:\Program Files\do.net\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5):

This is my WebApi.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <RuntimeIdentifiers>win7-64;win7-86;ubuntu.16.04-x64;win10-x64;osx.10.11-x64</RuntimeIdentifiers>
  </PropertyGroup>

  <PropertyGroup>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <LangVersion>7.1</LangVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <NoWarn>1591</NoWarn>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <NoWarn>1701;1702;1591</NoWarn>
  </PropertyGroup>

  <ItemGroup>
    <None Remove="swagger.css" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="xxxxxx" Version="x.x.x" />
  </ItemGroup>


  <ItemGroup>
    <ProjectReference Include="..\xxxx.csproj" />
  </ItemGroup>

</Project>

as @Neil said

Remove the whole 'runtimeIdentifiers' section, you only need it if you are doing cross-platform work.

this way solved my problem.

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