且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 .net core 控制台应用程序中使用 .net 类库时,项目构建失败

更新时间:2023-02-13 07:43:03

.NET Core 不消耗 .NET Framework (net###) 目标;它可以使用 netstandard*netcoreapp*.

.NET Core doesn't consume .NET Framework (net###) targets; it can consume netstandard* and netcoreapp*.

所以;您的 FxCore 将需要定位/多定位 .NET Standard 或 .NET Core 之一.

So; your FxCore is going to need to target/multi-target one of .NET Standard or .NET Core.

在选择什么目标/多目标方面:

In terms of choice of what to target/multi-target:

  1. target netstandard* - 如果您在实现中不需要任何特定于框架的内容
  2. 多目标 netcoreapp*netstandard* - 如果您想在 netcoreapp* 功能可用时使用它们,或者使用向下否则 - 级通用实现
  3. 多目标 netcoreapp*net### - 如果实现完全特定于平台并且不可能有通用实现
  1. target netstandard* - if you don't need anything framework-specific in the implementation
  2. multi-target netcoreapp* and netstandard* - if you want to use netcoreapp* features when they are available, or use a down-level common implementation otherwise
  3. multi-target netcoreapp* and net### - if the implementations are completely platform specific and no common implementation is possible

(其中 */### 是您选择的版本 - 可能是 netstandard2.1netcoreapp3.1code> 和 net472/net48 在当前时间)

(where * / ### is your choice of versions - probably netstandard2.1, netcoreapp3.1 and net472/net48 at the current time)