A few weeks ago, I learned that a new version of the .NET platform was officially released in November 2021. We knew we had to update soon to get the new improvements. We also didn't want to fall too far behind, even though we were using .NET 5 and that version is supported until May 2022.
But, since it had been a long time since I had programmed in C#, I didn't know how we could update our projects. Will it be difficult to upgrade? Are there any other implications? 🙈
So what did I do? I searched the Web and found it's easier than you think! At least with the right tools! 😉
I'll document it here for a quick reference if I need to.
Microsoft Visual Studio
In my case, I already had the Community Edition.
If you're using Microsoft's official IDE, Visual Studio, the procedure is quite simple. It only has five steps:
- Open your project solution with Visual Studio 2022.
- In the top menu of the IDE, click on
Projectthen onProperty of YOUR_PROJECT.

- Under
Application→General→Target Framework, select.NET 6.0.

- Save with
Ctrl + S. - Launch your app and make sure it's still working properly.
It's simple when you know it, isn't it? 😅
JetBrains Rider
If you are more a JetBrains fan and use their official IDE for .NET applications, Rider, the procedure is also quite simple:
- Open your project solution with JetBrains Rider.
- Right-click on your project and select
Properties.... You can also use theAlt + Entershortcut.

- Under
Properties→Application, click on the...button next to theTarget frameworkproperty.

- In the new modal window named
Edit Target framework, click on thenet5.0checkbox to deselect it and click on thenet6.0checkbox to select it. - Click on the
OKbutton to close the modal window and to return to theProject Propertieswindow.

- While you're at it, you may have noticed the
Language Versionproperty which is currently set toC# 9.0. You can change it toC# 10.0to make sure you're using the latest version available. - Click on the
OKbutton to save your changes and to close theProjet Propertieswindow. - Finally, make sure your application still builds and runs as before.
There you go, your application now runs under the .NET 6 framework! 🥳
Manual file editing
If you take a look at the only modified file, the YOUR_PROJECT.csproj file, you may notice that we could also just modify it. 😮

.csproj file after our changes.It's a lot faster, don't you think? 😂
Conclusion
The next step will also be to update your dependencies. But that will be in another article! 😅
Ressources









