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

标签 c# .net nuget asp.net-core .net-core

我注意到 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/

相关文章:

c# - 骰子面值识别

c# - 为什么 HttpClient 总是给我相同的响应?

c# - 如何抑制 Tasks.Task 不同的 PublicKeyToken 错误

C# sqlConnection 类在动态传递参数连接字符串时不接受连接字符串

c# - ASP.Net/JQuery : PLUploader "Add Files" will not fire after uploading images

c# - 在 C# 中包装 Visual C++

.net - Visual Studio - 将 Nuget 包添加到 MacO 中的项目时,访问路径 '/Users/.local/share/NuGet' 被拒绝

c# - 关闭 Excel 工作簿 - System.Runtime.InteropServices.COMException : Exception from HRESULT: 0x800A03EC

c# - 如何保存窗体中的控件

.net - WCF安全模式是TransportWithMessageCredential使用UserName,在哪里验证?