将参考项目升级到 .Net Standard 2.0 后无法编译 UWP Class 库

Unable to compile UWP Class library after upgrading reference project to .Net Standard 2.0

之前我有一个针对 .Net Standard 1.4 的 class 库,但我将其升级到 .Net Standard 2.0 并且还更新了 UWP class 库以针对 SDK 16299 但在编译 UWP 时Class 库项目出现以下错误:

The type 'DateTime' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

好像我遗漏了什么,但实际上无法弄清楚它是什么,也尝试通过添加下面的行来修改 .csproject,但这也没有用。

 <ItemGroup> <Reference Include="netstandard" /> </ItemGroup>

经过四天的调查,我终于能够构建解决方案。 以下是我为使其工作而遵循的步骤:

1> 从 Nuget

安装 Microsoft.NETCore.Runtime.CoreCLR

2> 升级到最新版本Microsoft.NETCore.UniversalWindowsPlatform

我仍然不确定为什么我需要 CoreCLR 库,如果有人对此有解释,我将不胜感激。就我的项目正在建设而言,现在还可以。