Page 20 - MSDN Magazine, September 2017
P. 20

.NET STANDARD
Demystifying .NET Core
and .NET Standard
Immo Landwerth
As the newest members of the .NET family, there’s much confusion about .NET Core and .NET Standard and how they differ from the .NET Framework. In this article, I’ll explain exactly what each of these are and look at when you should choose each one.
Before going into detail, it’s helpful to look at the larger pic- ture of .NET to see where .NET Core and .NET Standard fit in. When.NET Framework first shipped 15 years ago, it had a single .NET stack that you could use for building Windows desktop and Web applications. Since then, other .NET implementations have emerged, such as Xamarin, which you can use for building mobile apps for iOS and Android, as well as macOS desktop applications, as shown in Figure 1.
Here’s how .NET Core and .NET Standard fit into this:
• .NET Core: This is the latest .NET implementation. It’s open source and available for multiple OSes. With .NET Core, you
can build cross-platform console apps and ASP.NET Core
Web applications and cloud services.
• .NET Standard: This is the set of fundamental APIs
(commonly referred to as base class library or BCL) that all .NET implementations must implement. By targeting .NET Standard, you can build libraries that you can share across all your .NET apps, no matter on which .NET implementa- tion or OS they run.
.NET Framework
.NET Core
Xamarin
WPF Windows Forms Console ASP.NET
Console ASP.NET Core
iOS Mac OS Android
.NET Framework BCL .NET Core BCL Mono BCL
This article discusses:
• Using the “dotnet” command-line tool to create, build and test .NET Core projects
• Using .NET Standard to build libraries that run on any .NET implementation
• Reusing .NET Framework libraries through the .NET Standard 2.0 compatibility mode
Technologies discussed:
.NET Standard, .NET Core, .NET CLI
16 msdn magazine
Figure 1 The .NET Landscape
Base Libraries App Models







































































   18   19   20   21   22