新的 netstandardapp 和 netcoreapp TFM 有什么区别? [英] What's the difference between the new netstandardapp and netcoreapp TFMs?

查看:24
本文介绍了新的 netstandardapp 和 netcoreapp TFM 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到 NuGet 最近添加了对与 .NET Core 相关的几个新 TFM 的支持,包括:

  • 网络标准 (1.0-1.5)
  • netstandardapp (1.5)
  • netcoreapp (1.0)

据我所知,netstandard 是可移植配置文件的 .NET Core 等价物;它允许您使用单个名字来定位多个平台,而不是明确说明您支持的每个平台,例如portable-net45+netcore45+wp81.

同时,根据

I noticed that NuGet has recently added support for several new TFMs related to .NET Core, including:

  • netstandard (1.0-1.5)
  • netstandardapp (1.5)
  • netcoreapp (1.0)

To the best of my knowledge, netstandard is the .NET Core equivalent of a portable profile; it allows you to target multiple platforms using a single moniker, instead of explicitly spelling out every platform you support, e.g. portable-net45+netcore45+wp81.

Meanwhile, according to this document netstandardapp is more like a console application in .NET Core; it represents something that any .NET Core runtime (e.g. CoreCLR, CoreRT).

What, then, exactly is netcoreapp supposed to be? I found the tracking issue for it here, which includes a comment at the bottom that kinda explains what the difference is, but I don't get what the difference between

NETStandard.Library + app hosts

and

.NET Core base install

is. Could someone please explain it to me?

解决方案

The .NET Standard Library (netstandard) is a consistent library across application models. .NET Core (netcoreapp) runs on top of .NET Standard Library and is a AppModel. From the GitHub page they answer what a .NET Standard application is and what the difference is with .NET Core (https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-standard-applications.md) and (https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md)

UPDATE: The .NETStandardapp is obsolete. The NETCore app replaces it (https://github.com/NuGet/Home/issues/2524)

Q: What is a .NET Standard application?
A: A .NET Standard application is an application that can run on any .NET Core runtime: CoreCLR (current) and .NETNative (future). It can run on one of many .NET core platforms (Windows, OS X, and Linux). It relies on the host provided by the given runtime. It's a composable framework built from the packages on which the application depends. Its assembly loading policy permits newer versions of dependencies without any application configuration (for example, BindingRedirects are not required).

Q: How is this different than .NETCore? A: The .NETCore target framework represents Windows 8, Windows 8.1, and Universal Windows Platform applications. For compatibility purposes this moniker cannot be reused for ".NET Core applications". The branding overlap is unfortunate.

Q: How is this different than .NETStandard?
A: The NETStandard target framework is an abstract target framework that represents API surface of many frameworks and platforms. As such NETStandard assemblies can run on any platform that supports the NETStandard targeted by that assembly, for example: .NET Desktop, Windows Phone, Universal Windows Platform applications, .NET Standard applications, etc. NETStandardApplication is a concrete target framework that represents a single platform with both API surface and implementation. .NET standard applications are runnable on their own. .NETStandard libraries must be published-for or consumed-by a specific concrete target framework to be used in that type of application.

这篇关于新的 netstandardapp 和 netcoreapp TFM 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆