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

编程入门 行业动态 更新时间:2024-10-19 17:26:48
本文介绍了依赖 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,因此您需要通过导入部分告诉 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,因为它们应该在 99% 的 .NET 情况下工作Core(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来恢复非PCL或至少不支持win8/wpa8和net45的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.6 和 dnxcore50.

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

本文发布于:2023-11-08 07:21:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568712.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持   框架   Microsoft   Composition   Version

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!