Introducing .NET Core 5

.NET Core 5 is an open source, general-purpose, and modular subset of the .NET Framework that is designed to be portable across platforms, with the goal of maximizing code reuse and sharing. .NET Core 5 is modular because it is offered in smaller assembly packages with mostly no dependencies rather than one large assembly that contains most of the core functionality. This is important for two reasons: Microsoft can update .NET Core 5 with an agile development model, while you as a developer can simply choose the functionality pieces that you actually need for your apps and libraries. Instead of adding assembly references, as you are used to doing if you have existing experience with Visual Studio, when developing for .NET Core 5, you get packages via the NuGet Package Manager, an integrated tool in Visual Studio 2015 that makes it easy to download and include libraries in your projects. It is used several times throughout the book and is discussed more thoroughly in Chapter 52, “Advanced IDE Features.”

Today, with .NET Core 5, you can build the following kinds of applications:

Image Universal apps for Windows 10 (see Chapter 36)

Image Cross-platform web applications with ASP.NET 5

Image Portable class libraries

Image Portable Console applications (currently available only for ASP.NET 5 Core)

The promise is that .NET Core 5 will run on Windows, Mac OSX, and Linux systems, which is a revolutionary change for Microsoft. For this reason, .NET Core 5 could be your primary choice in the future if you plan to build cross-platform web applications and apps for mobile devices. .NET Core 5 has two major components:

Image A small Runtime that is built from the same code base as the .NET Framework CLR (CoreCLR)—The .NET Core Runtime includes the same garbage collector and just-in-time compiler (RyuJIT), but it does not include features like application domains or code access security. The Runtime is delivered via NuGet and is currently represented by the Microsoft.CoreCLR package.

Image Base class libraries—These libraries offer almost the same code as the full .NET Framework BCL, but they have been refactored to remove dependencies, so that it is easier to enable a smaller set of libraries.

Applications you build with .NET Core 5 run in an isolated environment. Visual Studio 2015 packages the CoreCLR, the application package, and libraries used by your application all into one local package. With this approach, your applications are not affected by machine-wide versions of the full .NET Framework, and, most importantly, they have no dependencies on the operating system. And because .NET Core 5 could run on Windows, Mac OSX, and Linux, it provides a shared implementation of APIs exposed by each operating system so that you can write the same code, regardless of the platform the application will run on. With regard to Windows 10 apps, .NET Core 5 provides the core runtime, but applications are compiled with .NET Native, a new compiler that compiles managed code into native code. .NET Native compilation starts with the VB (and C#, too) compiler generating IL code, then it generates C++, and finally it compiles into native machine code. .NET Native makes the startup time for a Windows 10 app up to 60% faster, and it optimizes memory usage. Figure 1.3 provides a representation of the .NET Core 5 architecture.

Image

FIGURE 1.3 The .NET Core 5 layered architecture.

You’ll see an example of building apps on .NET Core 5 in Chapter 36, which provides information on building a universal app for Windows 10. This book does not provide any examples of building ASP.NET Core applications because Visual Studio 2015 does not include any project templates for Visual Basic 2015, at least at this writing. (This chapter was written using the Release Candidate of Visual Studio 2015.) If you are interested in walking through the source code for .NET Core, you can visit https://github.com/dotnet/coreclr. The source code for ASP.NET Core is available at https://github.com/aspnet/Home.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.213.238