[英]migrate .net core 2.2 to 3.1 issue
安裝 .NET core SDK 3.1 並將我所有項目的 SDK [在我的解決方案中] 從 .NET core SDK 2.2 升級到 3.1,並將擴展等所有包更新到 3.1 版本后,我成功地構建了我的解決方案中的所有項目。
但后來我得到了這個錯誤:
C:\Program Files\do.net\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error.NETSDK1083 : 指定的RuntimeIdentifier 'win7 -64' 無法識別。 C:\Program Files\do.net\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error.NETSDK1083 : 指定的RuntimeIdentifier 'win7 -86' 未被識別。
這是我的 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>
正如@Neil所說
刪除整個“runtimeIdentifiers”部分,只有在進行跨平台工作時才需要它。
這樣解決了我的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.