December 07, 2021

Introduction

Recently .NET 6 was released. I decided to check it out since I wrote this site in Blazor using .NET 5. You can read more about how my site was created in my first blog post here.

.NET 6

Microsoft released .NET 6 on Novemeber 8, 2021. One of the most significant points to make about it, is it is a Long-term Support (LTS) release. This means that this version will be supported for the next three years. According to Microsoft's blog, .NET 6 is not supported on Visual Studio 2019, so you will need to download Visual Studio 2022 if you want to use it or upgrade and of your projects to it.

Digressing to Visual Studio for a moment, Visual Studio 2022 is a major update as well. It is the first release of Visual Studio that is 64-bit. This does tend to eat up a little bit more memory, but it hasn't been that noticeable to me so far and I have been using it a few weeks now. What has been noticeble though is the increased speed of Visual Studio. Throw in some other features such as a much improved Intellisense, and it is well worth the upgrade.

The one caveat to Visual Studio 2022 so far is that the team who develops the Business Intelligence extensions for Visual Studio for SQL Server Analysis Services, SQL Server Integration Services, and SQL Server Reporting Services, hasn't released the SQL Server Development Tools package for Visual Studio 2022 as of this writing. Once they release those, I will likely be switching completely to Visual Studio 2022.

Back to .NET 6, there are a few things that I am rather excited about. To start things off, it is touting increased performance for .NET code. Additionally, the compiler has been further optimized to better trim out unused code. This is supposed to make compiled applications smaller. Another thing I am excited about is Blazor has received some very cool updates. C# 10 is being introduced in this version of .NET. Last but not least, there is a new preview relase of .NET MAUI. While .NET MAUI is still in preview, I am excited to see progress on it as it looks like a promising technology.

You can take a more in-depth look at new .NET 6 features in the Microsoft Blog, but let's take a look at some of these and why I am excited.

Increased Performance

This one is pretty much a no brainer as to why I am excited about this. While this is super nice in the applications that are very data heavy, I also should see some improvements in simple things like this web site.

Optimized Code Trimming

Over the weekend I updated my site from .NET 5 to .NET 6 to see what kind of optimizations it would make. I didn't think about doing any speed tests on the code, however, I did do some testing on the code trimming optimizations that were made.

Using .NET 5, when publishing my website, it generated 498 files totalling at 123 MB. It is worth noting that this project is not strictly .NET. It also contains Bootstrap as well as other files such as images and other Javascript files.

Using .NET 6, when publishing my website, it generated 441 files totalling at 115 MB. That is a reduction of 57 files that are generated and an almost 7% decrease in size.

I am sure there are other things I can do to make the site smaller, but these are nice numbers considering all I did was update my project files to use .NET 6. I did some testing on my site and it looks like everything is still working the way it should.

Blazor Updates

This is another area where I was excited to see some improvements. I don't think Blazor is getting the recognition it should for how solid of a technology it is.

I am mostly a backend developer, so having a library I can use to write a website in mostly C# code is pretty fantastic.

One of the things I learned recently was the ability to use RUST libraries inside of Blazor.

Another feature I found to be very interesting is the ability to use blazor components in React applications. This shares the same authentication state and styling as the React app it is in. To make things better, you can pass in parameters from React into the Blazor component.

For a thorough rundown of these features, check out the video by Steve Sanderson where he runs through some examples in a very nice demo.

.NET MAUI

.NET Multi-platform App UI (.NET MAUI) has been in the works for a while now, and it looks like it is much closer to an official release. .NET MAUI does what its name implies. It allows the creation of an application that can be used across multiple different platofrms. This includes mobile devices such as Android and Apple devices, as well as desktop environments such as Windows.

I have dabbled in mobile development several times over the years, but have never done much with it due to the steep learning curve. I am hopefully that this new technology will greatly reduce that learning curve in making mobile apps. The added fact that the apps should be able to work on Windows desktop is welcome as well.

Conclusion

Overall, I am excited about the new changes introduced with .NET 6. I am glad to see .NET continuously evolving and giving us more ways to solve problems.

I don't have a comments section yet, so feel free to send me feedback on this blog.


Kevin Williams

Kevin is a data engineer and is the Business Intelligence Practice Lead at Software Design Partners specializing in data warehousing. He is a father, an occasional gamer, and lover of many different types of music.


The opinions expressed on this site are my own and may not represent my employer's view.
Share this post
About this blog...

I am excited for the release of .NET 6 and some of the enhancements it introduces.

Archives


An error has occurred. This application may no longer respond until reloaded. Reload 🗙