Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
167 views
in Technique[技术] by (71.8m points)

c# - What's the difference between the new netstandardapp and netcoreapp TFMs?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

Overview of .NET Future innovation


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...