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

编程入门 行业动态 更新时间:2024-10-19 13:25:54
本文介绍了依赖项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.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:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568714.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持   框架   Microsoft   Composition   Version

发布评论

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

>www.elefans.com

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