In this post we're going to take a look at the latest news and updates Microsoft and the various speakers shared at the annual .NET Conf conference.
This summary is a quick overview; we're not going to dive deep into every topic since that would make for a never-ending post—keep in mind there were nearly 40 hours of content.
I followed the conference live on my Twitter @NetmentorTw in this thread.
Table of Contents
Note: All images in this post are taken from the presentations.
1 - What's New in NET 6
Let's begin just like the presentation did; the first thing that stood out was the advent of .NET 6
and how the .NET team has built libraries that unify development for any type of app.
This means that if we want to develop web apps, cloud applications, desktop apps, games, or apps for a Raspberry Pi, the vast majority of the code will be the same, since it's at compile time when .NET 6 takes care of compiling to the specific target you need.
A recurring theme throughout the conference was performance and how much it has improved over previous versions. They noted that .NET 6 is up to 92% faster than .NET 5.
Of course, a lot of time was devoted to presenting what's new in C# 10, which we already covered in this post. For example, global usings
, improvements in lambdas, and minimal APIs.
We also saw presentations on the new version of F#, F#6
.
1.1 - Simplifying Development and Minimal APIs
There was a lot of content related to Minimal APIs. I previously wrote a post sharing my opinion, and in that post I mentioned some concerns I had, and I think those concerns have been confirmed.
The goal of Minimal APIs, as well as high-level programs, is 100% clear, since it was repeated constantly during the conference: Simplify the language, making things easier to attract new developers with experience in other languages like JavaScript.
In my opinion, the goal is to attract those developers who know using nodeJS
or expressJS
isn't the best backend option, but .NET was much more complex so they hesitated to make the switch.
That's great, but the problem is—as I feared—the code can end up as chaos, and we saw exactly that during the presentation:
This image is just a fragment of what was a single file with 30 endpoints. If things get a bit complicated, you end up with 2,000 lines of code in a single file.
Obviously, there are ways to clean this up and techniques to implement "clean minimal APIs", but unfortunately none were shown.
2 - Visual Studio 2022
Another novelty was the new version of Visual Studio. While there wasn't a dedicated conference (it was the day before), they showed new features and how things work under the hood.
They made a significant, really significant emphasis on hot reload, which amazed me because, as you know from the video I made on YouTube, there were initially plans to remove it. But I'm glad they finally included it for everyone free of charge.
In the videos I've recently made, I've already been using VS22, so I've tested it. One of the main changes is the interface, which I personally like.
Besides that, they announced support for Blazor, MAUI, and even WebForms right inside Visual Studio.
Then, as usual, improvements such as Click and deploy
, integration with Azure, with GitHub Actions, or code autocompletion.
I want to take a special moment for code completion: the Roslyn
team gave a presentation on how it works behind the scenes and how it uses machine learning
.
By the way, .NET 6 only works in Visual Studio 2022, not in previous versions.
3 - Azure
There wasn't anything specifically about Azure, but it kept popping up in each presentation. For example, we saw improvements in cosmosDB
during the Entity Framework
talk, and saw some details about azure container apps
when they discussed K8s.
We did have a presentation about Azure Functions and its roadmap.
They mentioned that lots of .NET features/programs work better on Azure than on other platforms. Personally, I don't like this; I understand the economic motive, but it feels like a slap in the face to those of us who don't use Azure.
4 - Entity Framework Core 6
There were many mentions to overall language performance, but where improvement is most visible is Entity Framework
. We saw a presentation emphasizing this, even claiming that dapper is, in certain ways, only 2% superior to Entity Framework Core
.
Whether that's true or not, the difference is notable:
Other points mentioned during this presentation included extending the number of data attributes you can assign to types; for instance, now you can specify
The “Precision” attribute, and when you operate in the database, it automatically indicates the precision.
public class Product{ [Precision(18,2)] public decimal Price { get; set; } public string Name { get; set; } public Product(string name, decimal price) { Name = name; Price = price; }}
Or when you need to map a type, you can do it all at once with default conventions in the dbcontext configuration
configurationBuilder.Properties<String>().HaveMaxLenght(200);
5 - Blazor Improvements in .NET 6
Personally, I'm really glad to be writing this section, since it means Microsoft hasn't just kept Blazor alive, but is investing more and more resources. This indirectly means many more companies are adopting it for their front-end projects.
Several improvements for Blazor. As usual, the main improvement is performance, specifically in AOT
(ahead-of-time compilation). They showed an app drawing satellites in orbit on a screen—in a normal Blazor app, it could handle 12,800 spinning satellites (at 60fps), while under AOT it could handle 58,200.
Of course, this comes at a cost: app size, because what AOT does is compile to native code before deployment so the client's browser doesn't have to interpret anything—it runs natively.
They showed a size comparison and explained that while AOT is a solution, it's not always the right one: in this scenario yes, but for an enterprise app, maybe not so much.
Also, as you can see in the image, Blazor WebAssembly is smaller than in previous .NET versions. In fact, we saw that the service worker itself is only 353kb, which is impressive.
We also saw hybrid applications that let you run code written in Blazor through MAUI.
This feature was already presented last year, but it was referenced again because it’s proving to be very powerful.
To wrap up this section, I'll mention that Microsoft has created Blazor components with the fluent-ui
design language used by Windows.
6 - MAUI
Unfortunately, MAUI isn't coming out officially with .NET 6; instead, it will launch Q1 2022;
What we did get to see were demos and presentations that worked perfectly, even though no performance numbers were given. So, I assume that everything is in place for developers, and now the team just needs to improve the codebase behind the scenes.
This is one of those features you can't believe works until you see it: yes, a single codebase for iOS, Android, Desktop, and macOS. And if your web is built in Blazor, you can have the web side handled by the same code too.
7 - ASP.NET Core MVC
Microsoft hasn't forgotten all the developers working with ASP.NET Core Mvc
and brings us improvements, especially in performance.
Besides performance, it brings features like Css Isolation
(already available in Blazor
), Async Screaming
, and even better interaction with OpenAPI
.
8 - Machine Learning in .NET 6
Regarding machine learning and ML.NET
, I wasn't going to mention anything as I'm not very up-to-date on it, but @Jonas_1ara told me about the highlights in this thread (thank you very much :D) and I'll share them here:
The main benefit of ML.NET
is adding an abstraction layer for a huge number of scenarios, saving developers a lot of headaches—for example, compared to TensorFlow
.
During the conference, there was a big focus on ML Builder
because it's easy to use and supports CLI; plus, it's already used by many internal Microsoft clients such as the Office suite, Bing, and external clients.
One main goal is to optimize model usage via ONNX Runtime
and, hopefully, provide full C#
support in PyTorch
via TorchSharp
, which aims by the end of 2022 to consume Python algorithms from C#.
9 - Special Mentions
Finally, I want to mention the projects that most caught my interest during the conference sessions:
- First, for
.NET Framework
, a new version4.8.1
will be released, we'll have to see what's new. - .NET Upgrade Assistant, a new app that guides you in migrating from older apps like WinForms or .NET Framework to .NET 6; Link.
- Apps for Microsoft Teams, you can now develop apps for Microsoft Teams, and they work not just on desktop, but also on mobile and the web version.
- Playwright, a library for UI testing with .NET; Link.
BUnit
, a library forunit testing in Blazor
; I've been following it for a while and I'm glad it got a mention here. Maybe we'll see a video about it for the channel; Link.Dapr
, software that is added as a sidecar to your applications and abstracts away many headaches in distributed systems, such as service discovery. Maybe we'll talk about it on the channel; Link.Yarp
, another reverse proxy, developed by Microsoft, looks like a reverse proxy as code, and is used in their production environments; Link.Mass transit
, I'm sure many of you know this library; it's very versatile, mainly acting as a layer on top of service bus. Likely to be covered on the blog or channel during 2022; Link.IoT
, Over the three days, there were .NET sessions running on unusual places, like a Raspberry Pi or a remarkable 2 e-ink tablet; several sessions are available if you're interested.
If there is any problem you can add a comment bellow or contact me in the website's contact form