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

James Ko picture James Ko · May 1, 2016 · Viewed 26.5k times · Source

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?

Answer

Martijn van Put picture Martijn van Put · May 1, 2016

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