gpt4 book ai didi

c# - 新的 netstandardapp 和 netcoreapp TFM 之间有什么区别?

转载 作者:IT王子 更新时间:2023-10-29 03:42:15 25 4
gpt4 key购买 nike

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

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

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

同时,根据this document netstandardapp 更像是 .NET Core 中的控制台应用程序;它代表任何 .NET Core 运行时(例如 CoreCLR、CoreRT)。

那么,netcoreapp 究竟应该是什么?我发现了它的跟踪问题 here,其中包括底部的评论,有点解释区别是什么,但我不明白

NETStandard.Library + app hosts

.NET Core base install

是。有人可以给我解释一下吗?

最佳答案

.NET 标准库 (netstandard) 是跨应用程序模型的一致库。 .NET Core (netcoreapp) 在 .NET 标准库之上运行,是一个 AppModel。他们从 GitHub 页面回答什么是 .NET Standard 应用程序以及与 .NET Core (https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-standard-applications.md) 和 (https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md) 的区别

更新:.NETStandard 应用程序已过时。 NETCore 应用程序替换它 ( 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.

Overview of .NET Future innovation

关于c# - 新的 netstandardapp 和 netcoreapp TFM 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36962930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com