.NET 8 Highlights - NetConf 2023 Recap

Like every year around this time, we have a Microsoft conference to present the new features of the language. This year, the new version is .NET 8.

 

If you want a quick version, the typical TL;DR, it's very simple, for me, this is version 6.1.5, but if you want to know why, you'll have to read the rest of the post.

 

 

 

1 - What's new in C# 12

Like every year, a new version of C# is here, this time it's C# 12. On this blog, we already saw a post about the new features which are, well, there they are. In my opinion, the most notable are the primary constructors, and the rest of the features are just… meh.

But as I said, you have them all in the post.

 

It's true they didn't list them as such in the conference, but they dropped some tidbits across different sessions.

The best part of the new .NET 8, and in this case C# 12, is the LTS version (long term support), meaning your company will allow you to migrate from previous versions as this one, unlike .NET 7, has long-term support from Microsoft.

 

Here on the blog, we don't cover F#, but we won't ignore it either. You can find a list of what's new in this post.

 

By the way, on the last day, when projects are presented every 20 minutes, one of them covered source generators and interceptors. The library is here (fashOware), and when the video is available, I'll update here, since it's quite interesting.

 

 

2 - .NET 8 Performance Improvements

A new version usually means performance improvements. This year, there have been quite a few, but when it comes to total performance, nothing ground-breaking, they touched on it quickly, mentioning that an app in net 7 and net 8 would see the following differences:

net 7 vs net 8 request per secondThe left chart shows a simple API receiving a JSON, and the right one is the same, but modifying the database.

 

This image shows the same app can process 24% more requests per second with the same memory and processor, which is massive. Beyond a more in-depth session later, they didn't mention much more at the keynote.

 

Personally, in my current client, we have microservices receiving 60k requests per minute. This change is really important for us.

 

Finally, on this point (since, as I said, they didn't go into much more, separate session later), they mentioned improvements in asp.net core and net maui, though not very flashy since they focused more on bug fixes.

 

 

3 - Blazor Updates in .NET 8

As hinted last year, Blazor is no longer just a front-end framework. It's now definitely Full Stack.

 

This was one of the sessions I was most interested in since there was an early preview of blazor unified a few months ago. During the conference, they only actually called it "blazor unified" once, but the idea remains the same.

 

If you know about Blazor, there are "formats" like Blazor Server and Blazor WebAssembly, each with pros and cons. During the event, they announced a new version called SSR (Static Server-Side Rendering).

blazor options

And why this version?

The problem with Blazor was that you either had a SPA or needed persistent websockets, which brought their own set of problems.

Now those problems are gone, we can have our website in Blazor acting like a "normal" site (and I put normal in quotes because 99% of websites out there are like this, sites to read information; you only interact with links. So, a classic website, just like this blog.)

 

And no, you couldn’t do this in Blazor until now. This blog ran on Blazor and, to be indexed by Google (for SEO), I had to use a huge hack; in the end, I removed it from Blazor because of that.

 

Of course, SSR isn't a silver bullet , it has pros and cons:

blazor ssr pros and cons

As you can see, SSR lets us build a static website using Blazor. But here's the magic: you can build interactive components simply by changing one line of code.

 

Their example involved a typical online store, the site uses SSR, but, when you open the chat component, it runs as Blazor Server and uses websockets for real-time communication, but only in that chat component while it’s open.

 

Personally, I love it. I highly recommend watching Steve Sanderson’s talk , it's AWESOME, showing all the types and differences, etc.

 

We'll see how adoption goes, because with Blazor, we aren’t just looking at one "format"; now there are 3, and while that's good, it's tricky as each one has different ways to handle authentication, http context, or even database context.

 

 

 

 

That's all for .NET 8 , or at least what I consider to be .NET 8: changes tied directly to having this version. Everything coming up now are programs or libraries that could work just fine in .NET 6 since they're independent from the language. That's why at the beginning I called this version 6.1.5, because last year felt like 6.1 rather than 7, and this year, more of the same.

 

 

4 - Changes in Visual Studio 2022

Something I didn’t expect at all were changes in Visual Studio. While they're not huge, they're appreciated. Starting from the new version (Visual Studio 2022 v17.8), we’ll have access, if you use Open API, to the API specification, directly in the IDE and in real time. Plus, with a right-click, you can generate an http file to call the API.

 

It's a feature common in other IDEs and languages, but not so common in C#, so it's nice to have.

 

Additionally, I also noticed hot reload is working better than before, or at least as expected. I need to check on my own machine, since it still fails a lot for me.

 

 

5 - MAUI in .NET 8

You might have thought MAUI was dead, BUT NO! They’re just fixing bugs, because yes, that's been all (and a quick performance measurement) they mentioned, even with a segment in the keynote...

 

Personally, I think Avalonia or Uno is still a better alternative if you really want to do something natively.

maui, avalonia, uno

But, if you ask me, my opinion is that 99% of apps should be web apps with a shell, in this case MAUI, which lets them run on desktop/mobile.

If Slack, a company valued at 27 billion dollars, does it, so should you. For C#, you can do this with Blazor Hybrid: it's very straightforward and works quite well.

 

Ah! Almost forgot, just like we have C# Dev Kit in Visual Studio, now we have one for MAUI too…

 

 

6 - Artificial Intelligence

AI AI AI!!!!!!!!! Haven't you heard? AI is everywhere these days, and of course .NET loves artificial intelligence.

 

.NET loves AI

What I don’t get is why this was in the main keynote, since they literally presented nothing new. Yes, throughout the conference there were sessions on AI history, model explanations, and workshops on using these models from C#, but honestly, it wasn’t great.

 

 

7 - .NET ASPIRE

.NET released a project/library that gives you, out of the box, a way to orchestrate different capabilities in your distributed apps, mainly observability, or libraries like rabbitMQ, Postgres or Redis. Basically, a bigger version of what I did back in the day in my Distribt project. Quite a copy if you ask me 😅

aspire vs distribt#IAmAVisionary

 

Obviously, they're not the same, but the idea is similar, and it's great. Aspire is meant for projects with tons of dependencies, it manages "everything," like what port, url, etc. It includes observability out of the box, which is essential in distributed environments. You can't go to microservices without observability, and this feature means you're covered. Of course, it's designed to work locally.

 

The main idea is to centralize a large portion of info, something most companies should do more often.

We’ll explore it more on this channel soon. For now, check out Microsoft’s blog post, which is very thorough.

 

 

8 - Other Highlights from NetConf 2023

8.1 - Cloud native

Focused on where they know customers have the biggest problems: observability, and doing things right.

Most of the presentations and workshops revolved around observability, for example, Grafana comes by default in Aspire. And then, container images are smaller by default, which reduces size, time, dependencies, and deployment speed.

 

There were several workshops about cloud native apps, including Azure Functions, and, of course, focused on Aspire, how to use an Aspire app and deploy it to Azure, stuff like that which makes sense at a Microsoft conference.

 

There were also other workshops covering OpenTelemetry (more observability), and how that's implemented in .NET. We've already covered OpenTelemetry in the blog and yes, in the Distribt course.

opentelemtrey net 8

And yes, the demos and workshops also used Prometheus and Grafana, just like mine :3

 

8.2 - Native AOT

Native AOT isn't finished, though it's a nice improvement. Here’s what’s new:

 

For those who don’t know what Native AOT (ahead of time compilation) is, here's a super quick explanation: when you build your C# app, you compile to IL (intermediate language), and then, when you "publish," the IL compiles to the target platform code. If you run on 32-bit, it compiles to that; if ARM, then so on.

 

The advantage is that you can strip a ton of unused features (well, not you, the compiler) which means better size and performance. For example, the app they showed shrank from 102 MB to 23 MB.

native AOT .net

By the way, for your app to use native AOT, all its dependencies need to be AOT-compatible.

 

2.3 - Default Identity API in templates

One of the big problems with C# is how authentication is handled, it’s a mess. The new version lets you create your app’s auth endpoints right out of the box. You don’t need to do anything; it just works.

We’ll cover this feature on the blog throughout 2024.

 

This post was translated from Spanish. You can see the original one here.
If there is any problem you can add a comment bellow or contact me in the website's contact form

Uso del bloqueador de anuncios adblock

Hola!

Primero de todo bienvenido a la web de NetMentor donde podrás aprender programación en C# y .NET desde un nivel de principiante hasta más avanzado.


Yo entiendo que utilices un bloqueador de anuncios como AdBlock, Ublock o el propio navegador Brave. Pero te tengo que pedir por favor que desactives el bloqueador para esta web.


Intento personalmente no poner mucha publicidad, la justa para pagar el servidor y por supuesto que no sea intrusiva; Si pese a ello piensas que es intrusiva siempre me puedes escribir por privado o por Twitter a @NetMentorTW.


Si ya lo has desactivado, por favor recarga la página.


Un saludo y muchas gracias por tu colaboración

© copyright 2025 NetMentor | Todos los derechos reservados | RSS Feed

Buy me a coffee Invitame a un café