依赖项Microsoft.Composition 1.0.27不支持框架.NETCoreApp,Version = v1.1 [英] The dependency Microsoft.Composition 1.0.27 does not support framework .NETCoreApp,Version=v1.1

查看:107
本文介绍了依赖项Microsoft.Composition 1.0.27不支持框架.NETCoreApp,Version = v1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将框架部分升级到:

When I upgrade framework section to:

"frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
      },
      "imports": "dnxcore50"
    }
  }

我遇到错误

依赖Microsoft.Composition 1.0.27不支持框架 .NETCoreApp,版本= v1.1.

The dependency Microsoft.Composition 1.0.27 does not support framework .NETCoreApp,Version=v1.1.

使用

"Microsoft.VisualStudio.Web.CodeGeneration.Tools"

"Microsoft.VisualStudio.Web.CodeGeneration.Tools"

:带下划线的

推荐答案

Microsoft.Composition 支持.NET Framework 4.5,Windows 8和WindowsPhone 8.1等其他目标,这意味着它应该可以工作.

Microsoft.Composition supports .NET Framework 4.5, Windows 8 and WindowsPhone 8.1 among other targets, this means it should work.

但是它并没有针对netstandard1.x,也没有针对netcoreapp1.x,因此您需要通过import部分告诉nuget来恢复针对上述平台的PCL库:

But it doesn't target netstandard1.x specifically neither does it netcoreapp1.x, so you need to tell nuget via the import section to also restore PCL Libraries which target the platforms above:

"frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
      },
      "imports": ["dnxcore50", "portable-net45+win8"]
    }
}

"portable-net45-win8"部分说明了这一点,它也同样可以还原具有.NET 4.5和Windows 8目标的PCL,因为它们在.NET Core的所有情况下都可以工作99%(Windows运行时基于System.Runtime和. NET Core也是如此,这就是它起作用的原因.)

The "portable-net45-win8" part tells it, to also restore PCLs with .NET 4.5 and Windows 8 targets too, as they should work in 99% of all cases with .NET Core (Windows Runtime is based on System.Runtime and .NET Core is too, that's why it works).

但是从不不能使用import恢复至少不支持win8/wpa8和net45的非PCL或PCL.

But NEVER use import to restore non-PCL or PCL which don't support at least win8/wpa8 and net45.

要在新的.csproj项目结构中执行此操作,您需要添加

To do that in the new .csproj project structure, you need to add

<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8</PackageTargetFallback>

相反.当您确定不使用任何使用这些软件包的软件包时,可以选择省略dotnet5.6dnxcore50.

instead. Optionally leave out dotnet5.6 and dnxcore50 when you're sure you don't use any packages which use any of these.

这篇关于依赖项Microsoft.Composition 1.0.27不支持框架.NETCoreApp,Version = v1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆