Microsoft .NET 8 arrives with cloud-native stack preview

.NET 8, the latest version of Microsoft’s open-source, cross-platform, application development platform, has arrived, bringing with it thousands of performance, security, and stability improvements. Like .NET 7 before it, .NET 8 puts an emphasis on cloud-native development, the company said. Generative AI also is a focus.

Announced November 14 and available at dotnet.microsoft.com for Windows, Linux, and macOS, .NET 8 is the latest LTS (Long Term Support) version of the platform, with three years of support. .NET 8 reshapes the building of “intelligent” cloud-native applications and high-traffic services that scale on demand, Microsoft said.

The platform update includes a new code generator, called Dynamic Profile-Guided Optimization (PGO), that optimizes code based on “real world” usage and improves application performance by as much as 20%. PGO is enabled by default. Support for the AVX-512 instruction set enables parallel operations on 512-bit vectors of data to process more data in less time. Microsoft noted that it is seeing improvements in the JSON API scenario of 18%, with nearly one million requests per second with ASP.NET Core Minimal APIs.

On the cloud-native development front, .NET 8 introduces .NET Aspire in preview form. .NET Aspire is an opinionated stack for building configurable cloud-native applications. It includes a set of components enhanced for cloud-native applications by using telemetry, configuration, resilience, and health checks by default, and enables discovery of essential dependencies for cloud-native applications. NET Aspire is due for general availability in spring 2024.

Microsoft said .NET 8 simplifies the use of AI via features in the .NET SDK and integration with several tools. Enhancements to the System.Numericscode library improve compatibility with generative AI workloads, such as integrating Tensor primitives. Microsoft has collaborated with various partners, such as Azure OpenAI and Qdrant, to ensure that .NET developers have access to AI models, services, and platforms through SDKs, the company said. The open-source Semantic Kernel SDK simplifies integration of these AI components into new and existing applications.

As for containers, Microsoft sought to make packaging applications easier and more secure. Every .NET image includes a non-root user for more secure containers and one-line configuration. The .NET SDK tools publish container images sans a Dockerfile and are non-root by default.

.NET 8 follows last November’s .NET 7, which also brought cloud-native development enhancements. Other new features in .NET 8:

  • C# 12, the latest version of Microsoft’s object-oriented, type-safe language, enables development of primary constructors in any class and struct with “simple and elegant” syntax. Developers no longer need to write boilerplate code to initialize fields and properties.
  • The F# 8 language includes new diagnostics, improvements in usability, and performance enhancements in project compilation. The FSharp.Core standard library has been upgraded as well.
  • With ahead-of-time compilation, .NET apps can be compiled into native code using less memory and starting right away. Also, apps can run in restricted environments where a JIT (just-in-time) compiler is not permitted.
  • The ASP.NET Core 8 web framework streamlines identity for single-page applications and enhances minimal APIs with form-binding, antiforgery support, and asParameters support for parameter-binding with OpenAPI definitions.
  • The Blazor web app builder lets developers use both server and client together to handle web UI needs. Enhancements focus on page load time, scalability, and user experience. Blazor Server and Blazor WebAssembly now can be used in the same app. Microsoft said .NET code now runs significantly faster on WebAssembly.
  • .NET MAUI (Multi-platform App UI) offers a single project system and codebase to build WinUI, Mac Catalyst, iOS, and Android apps. Native AOT compilation (experimental) now supports targeting iOS-like platforms.

.NET 8 is supported by the Visual Studio family of tools including just-released Visual Studio 2022 17.8. Developers also can create .NET 8 applications using Visual Studio Code with the C# Dev Kit or the GitHub Codespaces template for .NET.

Copyright © 2023 IDG Communications, Inc.

Source