为什么 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.
查看维基 netcoreapp1.0
的目标是 .NET Standard Library 1.6,但是当我尝试添加 netstandard1.6
而不是 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
.
是不是因为这样声明?
"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.type: platform
告诉 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屋!