【发布时间】:2020-05-28 06:27:04
【问题描述】:
在安装 .NET core SDK 3.1 并将我所有项目的 SDK [在我的解决方案中] 从 .NET core SDK 2.2 升级到 3.1,并将所有包(例如扩展程序)更新到 3.1 版本后,我成功地在我的解决方案中构建了所有项目.
但后来我得到了这个错误:
C:\程序 Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): 错误 NETSDK1083:指定的 RuntimeIdentifier 'win7-64' 不是 已识别。 C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): 错误 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>
【问题讨论】:
-
我猜
x不见了,win7-64应该是win7-x64,86也是如此 - 可以在这里看到:docs.microsoft.com/en-us/dotnet/core/rid-catalog#windows-rids -
我认为这是因为 Windows 7 最近被取消支持。
-
删除整个
<runtimeIdentifiers>部分,只有在做跨平台工作时才需要它。 -
@Neil 假设他没有做跨平台工作。
标签: c# migration .net-core-2.2 .net-core-3.1