使用 Profile44 在 PCL 中安装 NodaTime 2.2.x

Installing NodaTime 2.2.x in PCL with Profile44

我正在开发一个 PCL 项目,该项目使用 Profile44 作为 TargetFrameworkProfile。当我尝试安装 NodaTime 2.2.4 时,我收到以下错误消息:

Could not install package 'NodaTime 2.2.4'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.6,Profile=Profile44', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

我必须降级到 .Net 4.5 还是我有什么选择?

Noda Time 2.x 仅支持 Target Framework Monikers netstandard1.3net45。没有直接的 PCL 支持,尽管一些传统上使用 PCL 的环境现在支持 .NET Standard。

1.x 系列通过 Profile328 支持 PCLs,其 NuGet 目标为 "portable-net4+sl50+win8+wpa81+wp8"。对于尚不支持 .NET Standard 的环境,尝试 1.x 系列是最佳选择。

请注意,我期待 Noda Time 3.0 可能 目标 netstandard2.0,尽管我仍会保持旧版本在时区方面保持最新数据.