本文介绍了包[某些包的]不符合netcoreapp1.0兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DOTNET恢复我们收到以下错误:

包装Microsoft.AspNet.SomePackage 5.6.7不符合netcoreapp1.0(.NETCoreApp,版本= V1.0)兼容。包Microsoft.AspNet.SomePackage 5.6.7支持:net45(.NETFramework,版本= V4.5)

我们的project.json看起来是这样的:

Our project.json looks like this:

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.AspNet.SomePackage": "5.6.7",
    "Microsoft.NETCore.App": "1.0.0-*"
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "portable-net45+wp80+win8+wpa81+dnxcore50",
        "portable-net451+win8"
      ]
    }
  },
  "runtimes": {
    "win8-x64": {}
  }
}

我们如何能够 DOTNET恢复 DOTNET运行在运行我们的应用程序的方法吗?

How can we dotnet restore and dotnet run in a way that runs our app?

推荐答案

简短的回答是,你不能。在某些狭窄的情况下,你可以使用进口替代的NuGet内置的依赖规则。在这种情况下,你不能,.NET Framework和.NET的核心是不相容的。这些错误表示包只支持net45(.NET框架4.5)。你不能用你的.NET应用程序的核心使用它

The short answer is, you can't. In some narrow cases you can use imports to override nuget's built in dependency rules. In this case you cannot, .NET Framework and .NET Core are incompatible. The errors says the package only supports net45 (.NET Framework 4.5). You cannot use it with your .NET Core application

这篇关于包[某些包的]不符合netcoreapp1.0兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 14:18