DotNet Core 的 prorotobuf-net?

prorotobuf-net for DotNet Core?

我终于决定看看如果我尝试将我的(大型)项目迁移到 DotNet Core 2.1 会发生什么。就protobuf-net而言。据我所知,NuGet 包 (v2.3.11) 试图引入 .NET 4.0。我有点困惑,因为快速 Google 搜索听起来有些人正在使用带有 DotNet Core 的 protobuf-net。

项目网站 (https://github.com/mgravell/protobuf-net) 说首选的支持渠道是用 protobuf-net 标记的 SO 问题。所以,你开始吧:有没有一种简单的方法可以将 protobuf-net 引入我的 DotNet Core 项目,而无需引入一堆标准的 .NET 东西(除了克隆项目并尝试自己针对 DotNetCore 构建它)?

经过更多研究,protobuf-net 似乎确实支持 DotNet Core。按照 this Microsoft article, I installed NuGet Package Explorer, which tells me that protobuf-net include netstandard2.0. The naming is confusing, but, according to this article 中的说明,DotNet Core 2.0 实现了 .Net Standard 2.0。

简短版本:它已经完全支持 .NET Core,除了添加包引用(大概来自 nuget.org)之外,您不需要做任何事情。

更长的版本:

.NET Core 是两个不同的东西:

  • .NET Standard(共享目标标准,多平台实现)
  • .NET Core App(新的 .NET 核心平台)

nuget 上的包包含 .NET Standard 的目标,这意味着它可以 运行 在 许多 支持 .NET Core 的平台上,包括 .NET Core应用程序(实现 .NET 标准)。目前有 .NET Standard 1.0(下层平台)、.NET Standard 1.3(其他所有内容 1.)和 .NET Standard 2.0(所有内容 2.)的目标。我们可能还会很快添加一个 .NET Core App 2.1 目标,以允许一些特定的 2.1 平台功能。

请注意,您可以通过展开 nuget 上的 "Dependencies" 选项卡来查看目标平台:https://www.nuget.org/packages/protobuf-net