Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is .NET for Universal Windows Program a subset of .NET Core?

My confusion is I read that UWP uses .NET Core, but there's a separate ".NET for UWP" API documentation here. Also, I can't find some .NET Core features in my UWP project.

like image 610
Maydayfluffy Avatar asked Jul 31 '16 02:07

Maydayfluffy


2 Answers

Straight Answer: No it is not!

Long Answer: It's complicated

  • uap10.0 (UWP) and netcoreapp1.0 (cross-platoform .NET Core) are competing app models / SDK / Platforms (whatever terminology Microsoft chooses to mention next). I use the target framework monikers (the technical terminology) here onwards to avoid confusions around the term ".NET Core". uap10.0 focus on Windows based UI applications and netcoreapp1.0 is basically console applications for cross platforms (which like any programs can run servers, like ASP.NET).
  • The superset / subset question is tricky. They overlap. uap10.0 implements the netstandard1.4 and netcoreapp1.0 implements the netstandard1.6 (which is a strict superset to netstandard1.4) (platform standard documentation). However, both application models add significant additional libraries to it (uap10.0 adds e.g. the Windows.* libraries, while the library for netcoreapp1.0 called Microsoft.NETCore.App (NuGet) adds stuff like immutable collections, networking, filesystem, cryptography and other things which are not standardized (yet) across the .NET implementations).
  • The terminology ".NET Core" is basically screwed up. The CLR which runs uap10.0/UWP was derived from Silverlight which labelled its runtime coreclr. The modern cross platform netcoreapp1.0 uses a CLR derived from the UWP project. The same is true for the libraries which in all cases are System.Runtime based instead of mscorlib based.

Update August 2019

  • By now there is still the same difference between uap10.x and netcoreapp3.x. However, they both implement the netstandard2.x (and so do mono and unity). The netstandard2.x subset is a significant API surface making most nuget packages compatible with both.
  • to my understanding a big part of the winrt API surface will be accessible to netcoreapp3.x with their included COM support (covering winrt com and traditional COM). That makes the netcoreapp3.x intersection very significant. This is scheduled for later 2019.
  • netcoreapp3.0 will also support WPF and WinForms and other .NET Framework libraries. These will never be supported by uap10.0.
  • The UWP technology stack (which are several layers) are now support packaging/store treatment for any kind of app (not only uap/winrt once).
  • The real interesting stuff is coming with .NET 5 and 6. Java, WebAssembly and Swift interop, AOT compilation and MonoVM. The accessible library surface and the deployment locations will explode.
like image 71
Thomas Avatar answered Nov 15 '22 20:11

Thomas


.NET Core is a cross-platform subset of .NET that can be use to build apps for Windows, Linux, Mac, and yes, UWP.

UWP Api is also a subset of the .NET API, which can run on .NET Core. It also has a number of API's that are unique to UWP. UWP apps can be .NET core apps, but the reverse is not necessarily true. Not all .NET core apps are UWP apps.

Just like there are API's for .NET Core that only apply to Linux, or Mac.

like image 27
Erik Funkenbusch Avatar answered Nov 15 '22 21:11

Erik Funkenbusch