.net-core - 我可以使用 NETStandard.Library 1.5.0-rc2-24027 定位 netstandard1.6 吗?

标签 .net-core

我的库项目以 netstandard1.6 为目标并依赖于 NETStandard.Library 1.5.0-rc2-24027。项目编译。

我有一个引用库项目的控制台应用程序项目。控制台应用程序以 netcoreapp1.0 为目标并依赖于 Microsoft.NETCore.App 1.0.0-rc2-3002702(“平台”依赖项)。该项目不构建:

Project is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project supports: netstandard1.6 (.NETStandard,Version=v1.6).

One or more projects are incompatible with .NETCoreApp,Version=v1.0.

在没有引用库项目的情况下,控制台应用程序项目的构建成功。

这里的问题是 NETStandard.Library 1.5.0-rc2-24027 包还没有针对 netstandard1.6 吗? (参见 package information on NuGet.org。)

最佳答案

您的其中一个项目似乎以 netcoreapp1.0 为目标,但并非所有引用的项目都如此。我遇到过类似的问题。 我的目标是框架 netcoreapp1.0,但我使用的引用仅支持 netstandard1.6。

对我来说,解决方案是在我的 netcoreapp1.0 目标中导入 netstandard1.6:

"frameworks": {
    "netcoreapp1.0": {
         "dependencies": {
             "Microsoft.NETCore.App": {
               "type": "platform",
               "version": "1.0.0"
             }
          },
          "imports": [
              "netstandard1.6"
          ]
     }
}

关于.net-core - 我可以使用 NETStandard.Library 1.5.0-rc2-24027 定位 netstandard1.6 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37782998/

相关文章:

c# - 使用带有外部 Azure KeyVault (HSM) key 的 BouncyCaSTLe 创建证书时签名无效

Docker-compose down 会杀死一个应用程序

powershell - 您能否在 macOS 上的 Powershell 7 中使用 PtrToStringAuto 来解密安全字符串?

c# - Dotnet Core API - 获取 Controller 方法的 URL

tfs - MSBuild/t :pack Nuget-Package has always the same Version

visual-studio - .Net Core 是否支持每个环境的用户 secret ?

c# - 在 .net 核心控制台应用程序中创建一个 websocket 服务器

webpack - dotnet 发布在预发布完成之前运行

c# - 如何将 .NET 框架中的 gRPC 客户端与安全的 .NET Core 服务器连接?

asp.net-core - 如何正确解析要在 ASP.NET Core 3.1 的 ConfigureServices() 中使用的服务?