Announcing .NET 8

Gaurav Seth

We are happy to announce the availability of .NET 8, the latest LTS version of one of the world’s leading development platforms, starting today. .NET 8 delivers thousands of performance, stability, and security improvements, as well as platform and tooling enhancements that help increase developer productivity and speed of innovation. The .NET team, our partners, and the .NET community will be talking about what’s new in .NET 8 as well as what people are building with .NET today to meet their needs of tomorrow at .NET Conf 2023, a three day virtual event (November 14-16). Come, join us!

.NET 8 is now available

With this release, .NET reshapes the way we build intelligent, cloud-native applications and high-traffic services that scale on demand. Whether you’re deploying to Linux or Windows, using containers or a cloud app model of your choice, .NET 8 makes building these apps easier. It includes a set of proven libraries that are used today by the many high-scale services at Microsoft to help you with fundamental challenges around observability, resiliency, scalability, manageability, and more.

.NET 8 - Cloud Native Features

Integrate large language models (LLMs) like OpenAI’s GPT directly into your .NET app. Use a single powerful component model to handle all your web UI needs with Blazor. Deploy your mobile applications to the latest version of iOS and Android with .NET MAUI. Discover new language enhancements that make your code more concise and expressive with C# 12.

Let’s look at what’s new in .NET 8.

Unparalleled Performance – Experience the fastest .NET to date

.NET 8 comes with thousands of performance improvements across the stack. A new code generator called Dynamic Profile-Guided Optimization (PGO) that optimizes your code based on real-world usage is enabled by default and can improve the performance of your apps up to 20%. The AVX-512 instruction set, which is now supported, enables you to perform parallel operations on 512-bit vectors of data, meaning you can process much more data in less time. The primitive types (numerical and beyond) now implement a new formattable and parsable interface, which enable them to directly format and parse as UTF-8 without any transcoding overhead.

Every year we talk about the performance gains across .NET. This year we continue our quest to push the performance of .NET to new heights. From the latest TechEmpower benchmarks with .NET 8, we’re seeing improvements in the JSON API scenario of 18%, hitting nearly one million requests per second with ASP.NET Core Minimal APIs.

TechEmpower requests per second (RPS)

The Fortunes scenario is closer to a real-world workload, including database access and server-side HTML rendering. In this test, we see an even larger improvement of 24%, now over 300K requests per second with ASP.NET Core.

.NET Aspire – An opinionated stack to build observable, production-ready cloud-native applications

.NET Aspire is a stack for building resilient, observable, and configurable cloud-native applications with .NET. It includes a curated set of components enhanced for cloud-native by including telemetry, resilience, configuration, and health checks by default. Combined with a sophisticated but simple local developer experience, .NET Aspire makes it easy to discover, acquire, and configure essential dependencies for cloud-native applications on day 1 as well as day 100. The first preview of .NET Aspire is available today.

.NET Aspire

.NET 8 Container Enhancements – More secure, compact, and productive

Package your applications with containers more easily and more securely than ever with .NET. Every .NET image includes a non-root user, enabling more secure containers with one-line configuration. The .NET SDK tooling publishes container images without a Dockerfile and are non-root by default. Deploy your containerized apps faster due to smaller .NET base images – including new experimental variants of our images that deliver truly minimal application sizes for native AOT. Opt-in to even more security hardening with the new Chiseled Ubuntu image variants to reduce your attack surface even further. Using Dockerfiles or SDK tooling, build apps and container images for any architecture.

Modern containers

Native AoT – Journey towards higher density sustainable compute

Compile your .NET apps into native code that uses less memory and starts instantly. No need to wait for the JIT (just-in-time) compiler to compile the code at run time. No need to deploy the JIT compiler and IL code. AOT apps deploy just the code that’s needed for your app. Your app is now empowered to run in restricted environments where a JIT compiler isn’t allowed.

Before and After AOT

Artificial Intelligence – Infuse AI into your .NET applications

Generative AI and large language models are transforming the field of AI, providing developers the ability to create unique AI-powered experiences in their applications. .NET 8 makes it simple for you to leverage AI via first-class out-of-the box AI features in the .NET SDK and seamless integration with several tools.

.NET 8 brings several enhancements to the System.Numerics library to improve its compatibility with Generative AI workloads, such as integrating Tensor Primitives. With the rise of AI-enabled apps, new tools and SDKs emerged. We collaborated with numerous internal and external partners, such as Azure OpenAI, Azure Cognitive Search, Milvus, Qdrant, and Microsoft Teams, to ensure .NET developers have easy access to various AI models, services, and platforms through their respective SDKs. Additionally, the open-source Semantic Kernel SDK simplifies the integration of these AI components into new and existing applications, to help you deliver innovative user experiences.

Various samples and reference templates, showcasing patterns and practices, are now available to make it easy for developers to get started:

Infuse AI dotnet apps

Blazor – Build full stack web applications with .NET

Blazor in .NET 8 can use both the server and client together to handle all your web UI needs. It’s full stack web UI! With several new enhancements focused towards optimizing page load time, scalability, and elevating the user experience, developers can now use Blazor Server and Blazor WebAssembly in the same app, automatically shifting users from the server to the client at run time. Your .NET code runs significantly faster on WebAssembly thanks to the new “Jiterpreter”-based runtime and new built-in components. As a part enhancing the overall authentication, authorization, and identity management in .NET 8, Blazor now supports generating a full Blazor-based Identity UI.

Full stack Blazor

.NET MAUI – Elevated performance, reliability, and developer experience

.NET MAUI provides you with a single project system and single codebase to build WinUI, Mac Catalyst, iOS, and Android applications. Native AOT (experimental) now supports targeting iOS-like platforms. A new Visual Studio Code extension for .NET MAUI gives you the tools you need to develop cross-platform .NET mobile and desktop apps. Xcode 15 and Android API 34 are now supported allowing you to target the latest version of iOS and Android. A plethora of quality improvements were made to the areas of performance, controls and UI elements, and platform-specific behavior, such as desktop interaction adding better click handling, keyboard listeners, and more.

.NET MAUI Visual Studio Code Extension

C# 12 Features – Simplified syntax for better developer productivity

C# 12 makes your coding experience more productive and enjoyable. You can now create primary constructors in any class and struct with a simple and elegant syntax. No more boilerplate code to initialize your fields and properties. Be delighted when creating arrays, spans, and other collection types with a concise and expressive syntax. Use new default values for parameters in lambda expressions. No more overloading or null checks to handle optional arguments. You can even use the using alias directive to alias any type, not just named types!

Collection expressions

// Create a list:
List<int> a = [1, 2, 3, 4, 5, 6, 7, 8];

// Create a span
Span<char> b  = ['a', 'b', 'c', 'd', 'e', 'f', 'h', 'i'];

// Use the spread operator to concatenate
int[] array1 = [1, 2, 3];
int[] array2 = [4, 5, 6];
int[] array3 = [7, 8, 9];
int[] fullArray = [..array1, ..array2, ..array3]; // contents is [1, 2, 3, 4, 5, 6, 7, 8, 9]

See more about the latest version of C# in Announcing C# 12.

.NET 8 support across Visual Studio family of tools

We have a set of great tools that help you be the most productive in your development workflow and take advantage of .NET 8 today. Released alongside .NET 8, the Visual Studio 2022 17.8 release brings support for .NET 8, C# 12 language enhancements, and various new productivity features. VS Code and C# Dev Kit is a great way to get started with .NET 8 if you’re learning and/or want to quickly kick the tires of the runtime and is available on Linux, macOS, or in GitHub Codespaces. The new GitHub Codespaces template for .NET, which comes with the .NET SDK and a set of configured extensions, is one of the fastest ways to get started with .NET 8.

Additional features in .NET 8:

Get started with .NET 8

For the best development experience with .NET 8, we recommend that you use the latest release of Visual Studio and Visual Studio Code’s C# Dev Kit. Once you’re set up, here are some of the things you should do:

Celebrate .NET 8

.NET ❤️ Our Community

We would just like to end by saying one big…

https://dotnet.microsoft.com/thanks/8.0

81 comments

Discussion is closed. Login to edit/delete existing comments.

  • Hoffman, Scott M 1

    While I’m excited to work with this release myself, I’m also hoping we’ll get more developer stories on the .NET dev blogs regarding Microsoft product journeys to .NET.
    Always good to have real world success stories for inspiration!

  • 繁华 摘 0

    Congratulations on the release of .NET 8 and a big salute to the open-source developers behind it!

  • Jerome Boyer 1

    I am trying to figure out if SQLCLR will be updated to this version. Currently stuck to 4.8.

    • Michael Taylor 0

      SQLCLR follows the framework that the SQL runtime uses, which is currently .NET Framework. I think you should post your request to the SQL Server team about getting support for .NET Core.

      It has been asked before but I suspect there are challenges there starting with the fact that it would break all existing .NET components which is a big deal. Another issue is that it must sandbox such code so it doesn’t bring down the server. The original .NET Core releases couldn’t easily do that. However now that the framework has matured then maybe it is possible.

      Yet another issue is the LTS problem that everybody is complaining about. SQL Server generally has a 10 year lifecycle (or so) and that is beyond the lifecycle of any 1 .NET Core version. As such either SQL Server would need to have a shorter lifetime (unlikely) or .NET Core would need to have a longer lifetime (also unlikely). It would likely be easier to have SQL be able to load an arbitrary NET host (maybe self contained or AOT or something) so it is not directly connected to a NET Core version anymore. Even more likely is that support for NET would be dropped in lieu of using APIs (that SQL can now call) however that would be a serious perf hit compared to SQLCLR. And there is still the challenge of SSRS and SSIS which need integrated support.

  • Emediong Etuk 1

    Thanks to .NET 8.

    I think on Blazor Web App, when view source from the Browser the whole html doc can be copied and use to make another site, which is not good because of security, I think the way .NET 7 ,6,5,3 renders html doc is better, because in the previous versions of .net Blazor when view source on the browser you would not see html doc rendered, rather being rendered in app tag.

    • Tyler 2

      If viewing the html source of a web page is a security issue then you’ve made some serious problems.

      • Emediong Etuk 0

        I agree with you that security depend on the developer being able to handle it in the code, but I thought the rendering can be as in previous version of .NET.

        Thanks to the Team.

    • Tudor Turcu 1

      That’s just security by obscurity, similar to code obfuscation – not a deterrent to any serious attacker..

  • Brijesh BharadwajMicrosoft employee 1

    Regarding AOT Compilation, looking at the image, it shows a drop in RPS after AOT is enabled, can we get more detail added about that / perhaps a link to more context? Is the image incorrect?

  • samuditha jayawardena 0

    As a MacBook user, Visual Studio Code .NET extensions do not provide much support for development. Some packages are not working. Also, very exciting to anticipate .NET 8 features in the future.

    • Anurag Gandhi 1

      I am also facing the same issue.
      Hope tiny voice reaches big ears and will see good IDE for .net on Mac too.

    • Ben Croughs 0

      try using Jetbrains Rider instead of VS Code. I am in anyway not affliated with Jetbrains or so. But i have been using it for years now, and it is the best IDE for dotnetcore, I think personally better then Visual Studio on windows

  • Anurag Gandhi 0

    Good to see .net 8 new features and improvements.

    Microsoft don’t have any official good way to develop .net API on Mac.
    VS Code “C# Dev Kits” is too young and “VS for Mac” is almost retired.
    I believe Microsoft should relook on Mac users as well. Rider is the only good way for now, but its not the effort from Microsoft.

  • Michal Dobrodenka 0

    If anyone is interested, I build dotnet for armv6, can be used on first Raspberry Pi etc.

    https://hub.docker.com/r/taphome/dotnet-armv6/tags

    with this docker it’s possible to build self contained armv6 apps

  • David Clough 0

    Azure app services to catch up later this week, but what about Azure DevOps? We tried to deploy last night after using Preview for months and it refused because it’s still not properly integrated. I do feel all related platforms should’ve been updated together to be fair…

    • Tyler 0

      I added the “Use .NET Core” build task for v8.0.100 after updating a project to .NET 8 to get it to work. Seems the build agent images haven’t been updated yet.

    • Michael Taylor 0

      Build agents generally take a month to update. It isn’t just installing the NET SDK but also VS 2022 has to be updated from 17.7(?) to 17.8 because 17.8 is the first version to support NET 8 RTM. As Tyler mentioned you have to use the NET tool installer in your pipeline (and remove it later). However some folks believe that you should always have this anyway (just in case). But if you rely on any VS 2022 17.8 features then it still won’t work until they update the image.

      • Tudor Turcu 0

        Ideally, Visual Studio itself should not be needed for any automated build, only a SDK that can be independently deployed. Unfortunately, this is sometimes difficult..

  • Asharib kamal (Ashu) 0

    great work by the team Microsoft .net .major changes in .net. is build a full stack app with a single language c#..this is the best feature in .net 8 . thanks microsoft.

Feedback usabilla icon