Floyx system update [21.12.2022]

Floyx.com
3 min readDec 22, 2022

--

Support policy
.NET Core 2.1 have already reached the end of support on August 21, 2021. After that date, Microsoft will no longer provide updates or support for this version.
When .NET Core 2.1 reached the end of support, applications that used this version will continue to work. As a result, Microsoft is not providing any security updates for .NET Core 2.1 from September 2021. This means that if you have .NET Core 2.1 installed on your computer, it could potentially be insecure. And if someone encounters a problem and needs technical support, Microsoft may not be able to help them.

Why we chose .Net Core 6.0
We think this is a good question, because there are more choices available at any given time. We looked at what .NET versions are currently supported and when each will reach the end of support. We chose the LTS (Long-Term-Support) option for .NET 6 instead of .NET 3.1 because its end of support was already December 13, 2022. So we don’t have to worry about another update for at least 2 years, hopefully. Currently, the latest LTS version is .NET 6, which will be supported until November 2024.

Code update

In the image above, as you can see on the right side panel, there are several changes that are required for .NET 6
1. <TargetFramework>net6.0</TargetFramework>.
-> TargetFramework needs to be updated in each csproj file.

2. <PackageReference Include=”Microsoft.AspNetCore.App” />.
-> This line has been removed because the PackageReference to Microsoft.AspNetCore.App is not necessary when using .NET Core 3.0 or later. In these cases, they will be automatically referenced by the shared framework.

3. In the above image, you can see that we commented out //.AllowCredentails() because the CORS protocol does not allow you to specify a wildcard (any) origin and credentials at the same time.

4. You can also see that we changed the swagger doc from Swashbuckle.AspNetCore.Swagger.Info to OpenApiInfo, as it is no longer supported by .NET Core.

5. Many minor changes have been made, such as using IWebHostEnvironment instead of IHostingEnvironment, which is recommended by Microsoft when upgrading from 2.1 to 6.0, as they are not currently supported by .NET, and are not recommended as they will be removed in the near future.

Since our project uses docker, we updated all required .Net sdk and runtime references from version 2.1 to 6.0 in all docker file, as you can see in the image below.

In addition to all the changes mentioned above, there were also many minor code changes that were required for the project to work with .NET 6.0.

Performance improvements
- .Net Core was designed in a “pay-for-what-you-use” model, where performance is a key feature. With each version released, performance was improved by several percent.
- In .NET 6, profile-driven optimization (dynamic PGO) was introduced. Essentially, dynamic PGO is a JIT compiler optimization technique that allows the JIT to collect additional environment information (aka profile) in Layer 0 code to later rely on when advancing from Layer 1 to Layer 2 for hot methods. The goal is to make these methods even more efficient.
- .NET 6 is a huge improvement over .NET Core 2.0 and all the other versions in between. It has much better features and greatly reduces the amount of templated code that developers have to write to make their packages work.

For more information on the performance improvements, see the following page.
https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/

--

--

Floyx.com
Floyx.com

Written by Floyx.com

Building the next generation of human connections and social media on #web3. https://linktr.ee/Floyx

No responses yet