1. A Fresh New Design
Visual studio comes with a new fresh design, compared to older versions of visual studio. The very first thing that you'll see when you install the new version of the IDE is the refreshed UI. Microsoft says that this new design is aimed at decreasing the cognitive load, allowing us to stay in the zone.
1.1 Colorize Document Tabs By Project
One of the striking new features in the IDE are colored tabs. That has, for a long time, been one of the most requested features. With this new release, we can enable coloring the tabs, which is super useful in a multi‑project solution. Files of the same project are showing in the same color, making it easier to find the correct tab.
2.1 Modern, Refreshed Icons
One of the striking new features in the IDE are colored tabs. That has, for a long time, been one of the most requested features. With this new release, we can enable coloring the tabs, which is super useful in a multi‑project solution. Files of the same project are showing in the same color, making it easier to find the correct tab.
2.1 New Default Font
Yes, we look at source code all day, so why not use a good font to do so? For a long time, Microsoft has been defaulting to Consolas, which you see here on the right. With Visual Studio 2022, Microsoft is also including a new font, Cascadia. Just like Consolas, this is a fixed‑width font that has improved readability.
3. 64-bit Visual Studio
Visual Studio 2022 is the first version to run as a 64-bit process allowing Visual Studio main process to access more than 4GB of memory, preventing out-of-memory exceptions which could occur with large projects.
Maybe you have never noticed, but Visual Studio so far has always been a 32‑bit process. That means that it was so far always limited to using about 4 GB of memory, more was not possible. For many projects, this was enough, but with the increasing size of solutions that we create nowadays, a 64‑bit version will help greatly. Visual Studio 2022 isn't limited to memory use anymore, at least, it'll have to be a really large solution before you can cause it to go and run out of memory. On the developer blog of Visual Studio, Microsoft has posted a video of a solution containing over 1600 projects and thousands of files. And Visual Studio 2022 opens this nicely.
4. A new properties window
If you go to the Properties of any Visual Studio project, you can see that we got a new interface that shows the properties in a long scrolling list. Depending on the menu item you are in, the selection here will change on the left.
5. Hot Reload
Using Hot Reload, you can change your code while in debug, so while the application is running. In normal circumstances, you need to stop the debug session, make the code change, do a build, and then run. Now while we're used to this, it literally eats a lot of development time. Sometimes when I'm writing code, I get distracted while I'm waiting and I'm not in the zone anymore. With Hot Reload Code changes are visible directly in the running up. We now have a button to apply code changes to our running applications. Hot Reload is now working for most popular technologies inside Visual Studio 2022, including XAML, ASP.NET Core MVC and Razor pages, even for CSS, Blazor, C++,WinForms.
6. New Project Templates
Microsoft has invested in renewing the templates in Visual Studio. Templates are a key feature in Visual Studio. The set of templates we get is very extensive, and it's key that these templates are available for developers to start off their project on the right foot. One issue we had with these templates is that they weren't, well, fresh anymore. Now they were updated, of course, in terms of references to, for example, new versions of the .NET Core, but sometimes they'll still contain some old references, such as an old version of Bootstrap. That has now been changed.
6.1 Less Indentation, remove Unnecessary Code
For example, in Console Application with the help of C# 9 and 10 we can write much more compact code, here is a comparation between Visual Studio 2019 and 2022:
Both have created a Program class, but the file is pretty different, as you can see. In Visual Studio 2019(right solution), we have what we're used to. We see a namespace, we see a class, and then we see a static void Main. In Visual Studio 2022(left solution), however, we just see the only line that, in fact, does something, the Console. WriteLine("Hello World!"), and all the other ceremony is gone. That is possible due to changes made in C# 9 and 10, namely the top‑level statements, and these have now also been applied in the templates.
7. Refactoring and Intellicode
Refactoring and IntelliCode got a lot of updates, so Visual Studio has become more smarter. In my opinion Visual Studio has a lot of new refactoring suggestions, like extract method, code formatting, or suggestions like "convert to file-scoped namespace":
In my optinion it took a lot of Resharper ideas and integrated them into Visual Studio. I personally am really thinking if spending the extra licesing money on Resharper does still make sense. Probably not...
IntelliCode is giving us a lot more help when writing our code. I can assure you that when you have used this for a couple of days, you'll become addicted to it. For example, while writing a Data object class, you will get suggestions like:
Now, IntelliCode is backed by a service in the cloud. You can check the status of that by going to Help and then Check Service Status. And here you can see that IntelliCode is indeed coming from the cloud, and it is working fine at this point.
Conclusion
Within this article we briefly explored the VS 2022 refreshed UI, and we've seen it is now a 64‑bit process. Probably the biggest edition is Hot Reload, which allows us to make code changes without interrupting the development flow. Finally, we also peeked at updated templates and their easier, more accessible way of getting a project started.
IT
visual studio 2022 new features hot reload
12.11.2021
Acasa