With .NET Core 3.0, Microsoft takes a big step towards creating a better open-source, cross-platform framework for developers. The new release adds important capabilities that take the platform in new directions.
.NET Core 3.0 extends the range of applications you can build, comes with notable performance improvements, and brings a host of new features that help you build better software and web apps.
In this post, we’ll look at what’s new in the platform to see what makes this .NET release the most powerful and flexible to date.
Support for Windows Desktop Applications
You can now use Windows Forms and Windows Presentation Foundation (WPF) to build applications on .NET Core same as you would on the .NET Framework. .NET Core 3.0 supports UWP controls and Windows UI XAML Library styling.
In addition to building new desktop apps, you can also convert existing ones to .NET Core 3.0 apps through a relatively simple process. All you have to do is target and recompile the existing app and then update the project files.
With the introduction of desktop app development, Microsoft has broadened the scope of .NET Core, making it a more versatile choice for a broader range of developers.
Improved Application Packaging and Deployment
Packing and delivering applications has become easier with .NET Core 3.0. You can still use framework-dependent deployments, but these are no longer your only choice. Now you can also use single-file executables, as well as take advantage of the MSIX format.
- Single-file executables
You can now bundle all the dependencies needed to run an app on a given platform into a single-file package.
Self-contained single-file deployment is available for Windows x86 and x64, OS X x64, and Linux x64. Note that you have to create different deployments for each platform.
- MSIX deployment for self-contained .NET Core applications
.NET Core 3.0 supports the new MSIX application deployment format for Windows 10. MSIX enables self-contained applications to run into a virtual space. It simplifies both deployment and uninstallation.
As you may suspect, self-contained packages are considerably larger than framework-dependent packages. On the plus side, framework-dependent executables have gotten smaller.
Support for C# 8.0
The new release provides extensive support for the most simple and elegant C# version to date. With .NET Core 3.0, you can now take advantage of all the latest additions to C# 8.0 and use more patterns in more places.
Notable arrivals include:
- Nullable reference types
- Switch expressions
- Async streams
You can use these to boost your productivity and develop versatile web applications, services, and apps. For the full list of what’s new in C# 8.0, go here.
ASP.NET Core Improvements
We’ve talked about desktop apps already, so now let’s turn to web apps. With the new .NET Core, you can build web apps using a host of new library features and enhancements.
- MVC Service Registration now supports additional extension methods
New methods include AddControllers, AddControllersWithViews, and AddRazorPages. These methods come in handy whenever you’re building web apps that require Razor Pages.
- WEB UI framework improvements
Blazor now supports authentication and authorization handling, culture aware databinding, and case-sensitive component binding. These enhancements can help you avoid errors and speed up the development process.
- Endpoint routing
The endpoint routing process has become easier. You can now use endpoint routing directly, without having to rely on UseMvc ().
- gRPC support
You can now build microservices, multilingual systems, and point-to-point services using the Remote Procedure Call (RPC) framework. gRPC is lightweight, provides high-performance, and allows for language-agnostic implementations.
- Worker Service template
The new release includes a template for background Windows Services. With this template, you can implement Program or Worker classes that can simplify process hosting.
New JSON Serialization Library
You can boost performance while minimizing resource allocation using the built-in JSON library support. It’s good news for developers who have been using external JSON libraries like Json.NET. Now you no longer have to rely on them to implement JSON.
Support for HTTP/2
The HttpClient class now supports the HTTP/2 protocol, which is set to become the new standard for data communication over the internet.
Compared to its predecessor, HTTP/2 is less prone to errors and can reduce latency. It also has a smaller network footprint.
One thing to keep in mind is that the default protocol in .NET Core 3.0 continues to be HTTP/1.1. You have to enable HTTP/2 manually.
Crypto Support and Ciphers and Key Import and Export
.NET Core 3.0 makes authenticated encryption easy with support for AES-GCM and AES-CCM ciphers. You can now authenticate ciphertext before decryption to develop secure apps.
You can also import and export asymmetric keys without the X.509 certificate. You can do this for both public and private keys.
Since it supports standardized key formats, the new .NET core makes interoperation with other systems smoother than previous .NET releases.
Supported formats include PKCS#1 for RSA Keys, PKCS#8 for Asymmetric Keys, and PKCS#12 for Keystores.
The new release features some notable interop enhancements. For example, you can now use CoCreate COM APIs and Activate WinRT APIs through the Windows Native Interop, in addition to P/Invoke.
NET Core 3.0 makes managing native libraries easier through the NativeLibrary Class. Thinking of using interoperability to make the most of unmanaged code? .NET Core 3.0 won’t stand in your way.
.NET Standard 2.1
The updated standard adds over 3,000 APIs. Notable improvements include the Span type, which helps you manage buffers more effectively, Lightweight Code Generation (LCG), and Reflection Emit, which can help you optimize performance.
But bear in mind that by default, .NET Core 3.0 continues to use .NET Standard 2.0. To switch to 2.1, you have to update the TargetFramework property in the template.
Full Support for Artificial Intelligence and Machine Learning
.NET Core 3.0 provides full support for learning models integration through the ML.NET framework, which is currently in its preview stage.
.NET Core 3.0 also integrates with Cognitive Services, Azure Machine Learning, and F# for Data Science and Machine Learning.
Until ML.NET becomes more widely available, you may not be able to take full advantage of .NET Core 3.0 as a platform for building AI- and ML-infused apps.
But in the near future, as ML.NET gains adherents, .NET Core 3.0 is likely to become a more attractive platform for AI and ML app building, especially now that it lets you build a wider range of apps than ever before.
.NET Core 3.0 is the fastest .NET framework to date. It comes with internal code that’s better optimized as well as a few other significant improvements.
Notably, Tiered compilation is now on by default and will improve the performance of an app during its different execution stages.
Also, you can use the ReadyToRun (R2R) format to improve app startup times. With this type of ahead-of-time compilation, you can reduce the load on the JIT compiler, further optimizing performance.
Support for Internet of Things (IoT) Developments
Raspberry PI and ARM chip support are two other notable additions. With them, you can use .NET Core 3.0 to develop apps that listen to sensors. You can do this through the GPIO APIs.
Other sound reasons to choose the framework for IoT developments include assembly linking for reduced app size, Azure Secure Cloud support, and full compatibility with Windows 10 IoT Core.
.NET Core 3.0 doesn’t forget Linux users either. In introduces a few enhancements that can make it more attractive to them.
- SerialPort support is now available for Linux.
- TLS 1.3 & OpenSSL 1.1.1 support, which enables you to use the new version of the Transport Layer Security protocol to improve connection times and security.
- Support for ARM64, the standard architecture for newer devices.
The new .NET Core 3.0 enables you to build not only web and cloud apps, but also desktop, IoT, and AI-powered apps. You can take advantage of C# 8.0, .NET Standard 2.1, and the HTTP/2 protocol to do this. At the same time, you can develop better web apps with the richer and more versatile ASP.NET 3.0.
To boot, there’s better cryptography support, interop improvements, and more app packaging and deployment options. So that in the end, .NET Core 3.0 is likely to reward both those who have long anticipated the many improvements it brings and those who transition to it from other frameworks.
Microsoft plans to release the .NET Core 3.1 long-term supported (LTS) later this year. Upgrading from 3.0 to 3.1 will be an easy process, so you may as well upgrade to .NET Core 3.0 now if you haven’t done so already.