使用targetFramework生成Nuget =; netcore5.0"在.net5 c#项目中使用它
我有以下错误: NU1202:软件包XXX与Net5.0(.netCoreApp,version = v5.0)不兼容。软件包XXX支持:NetCore50(.netcore,版本= V5.0)
I am getting following error:
NU1202: Package xxx is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Package xxx supports: netcore50 (.NETCore,Version=v5.0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,
.netCore
和.netCoreApp
不是同一回事。 nuget在目标框架上的文档 是“ Windows Store”。我不确定这是否与UWP相同,尽管在文档中确实说uap
可以使用netcore
。无论如何,.NET 5的规范目标框架标识符是
.netCoreApp
(与早期的.NET内核相同,1.0至3.1),这是不同的。这只是一个不幸的名字选择,导致不必要的混乱,但这是我们到达这里的历史。
简而言之,您的.NET 5项目无法使用为UWP设计的软件包。
Unfortunately,
.NETCore
and.NETCoreApp
are not the same thing. NuGet's docs on target frameworks says that.NETCore
is "Windows Store". I'm not sure if that's the same thing as UWP, although in the doc it does say thatuap
can usenetcore
.Anyway, .NET 5's canonical target framework identifier is
.NETCoreApp
(same as all the earlier .NET Cores, 1.0 to 3.1), which is different.It's all just an unfortunate choice in names that leads to unnecessary confusion, but it's the history of how we got here.
In short, your .NET 5 project can't use packages designed for UWP.