为什么Microsoft.NETCore.App不支持netstandard1.6? [英] Why doesn't Microsoft.NETCore.App support netstandard1.6?
问题描述
我正试图开始使用.NET Core,但确实很头疼,难以理解所有这些新的命名方案。
I'm trying to get started with .NET Core and I'm really having some headaches to understand all this new naming scheme.
查看Wiki netcoreapp1.0
面向.NET标准库1.6,但是当我尝试添加 netstandard1.6
而不是<$时c $ c> netcoreapp1.0 我得到的软件包还原失败,因为Microsoft.NetCore.App不支持 netstandard1.6
。
Looking at the wiki netcoreapp1.0
targets the .NET Standard Library 1.6, however when I try to add the netstandard1.6
instead of netcoreapp1.0
I get a package restore failed because Microsoft.NetCore.App does not support netstandard1.6
.
是因为被这样修改了吗?
Is it because is delcared like this?
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
此外,键入平台是什么意思?
Also, what does type "platform" means?
推荐答案
您使用的是什么引用取决于您是构建应用程序还是共享库:
What you use and reference depends on whether you are building an application, or a shared library:
-
如果要构建应用程序(控制台,UWP,ASP.NET Core Web应用程序),您将定位
netcoreapp1.0
并依赖Microsoft.NetCore.App
。类型:平台
告诉NuGet您所引用的平台没有作为软件包安装。netcoreapp1.0
导入netstandard1.6
,这意味着它可以使用也针对netstandard1的库.6
或以下。
If you are building an application (console, UWP, ASP.NET Core web app), you'll target
netcoreapp1.0
and depend onMicrosoft.NetCore.App
.type: platform
tells NuGet that you are referencing a platform, which doesn't get installed as a package.netcoreapp1.0
importsnetstandard1.6
, which means it can use libraries that also targetnetstandard1.6
or below.
如果您要构建库(供其他库使用)或应用程序),您将定位 netstandard1.X
并依赖 NETStandard.Library
或直接引用NuGet程序包您需要。
If you are building a library (to be consumed by another library or application), you'll target netstandard1.X
and either depend on NETStandard.Library
or directly reference the NuGet packages you need.
这篇关于为什么Microsoft.NETCore.App不支持netstandard1.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!