Visual Studio 2022 17.1 is now available!

Dominic Nahous

Correction: We mistakenly indicated that a new feature for automatically saving files when Visual Studio moves to the background was available in the 17.1 GA release. This feature is only present in the 17.2 Preview release. We’ve since updated the post to fix our error.

Today, Visual Studio 2022 17.1 graduates from preview and reaches general availability. Feedback from developers like you have helped us shape and refine Visual Studio 17.1 through its preview cycle and we’d like to thank you for your part in Visual Studio’s journey.

In my last blog post for Visual Studio 2022 17.1 Preview 2, I shared details around exciting additions to Visual Studio that included enhancements in Git, Search and Navigation, productivity improvements in C# and C++, and added capabilities for personalizing colored tabs. Throughout the rest of the 17.1 Previews, we continued to address feedback you submitted via Developer Community. To see the full list of community feedback we’ve addressed, visit the fixes page on Developer Community.

In addition to fixes for customer-reported issues, we’ve also added made some changes to make you more productive in Visual Studio. You’ll also find improvements to solution close performance as a result of optimization of cleanup operations when closing a solution, which builds on the performance work we’ve been doing throughout the preview cycle. Continue reading to find out more, and as always, visit the Visual Studio 17.1 GA release notes for more information on everything in this release.

Search code faster with indexed Find in Files

With Visual Studio 2022 17.1, we’ve turned on indexed Find in Files by default to help ensure every developer experience a faster and more productive searching experience.

With Find in Files on, Visual Studio will launch a satellite process `ServiceHub.IndexingService.exe` at solution load or folder open and then send a list of files to it to index. The indexer will then scrape through the files and construct an index which is in turn used to speed up search results when you perform a Find action.

Side-by-side video of VS 17.0 (left) and VS 17.1 Preview (right) searching about 50,000 files in 1,560 projects
Side-by-side video of VS 17.0 (left) and VS 17.1 Preview (right) searching about 50,000 files in 1,560 projects

While indexed Find in Files is enabled by default for all users, you can opt to disable it by navigating to Tools > Options > Environment > Preview Features and unchecking “Enable indexing for faster find experience”.

Do more with Git

As we mentioned in the Preview 2 blog post, Visual Studio 2022 17.1 comes with some highly anticipated Git features to help boost your productivity. You can now compare your current branch with other branches in your repository, affording you an easier way to keep track of your branches with preparing for pull requests or branch deletion.

A screenshot of Visual Studio's Git compare screen

You’ll also find enhanced detached head support with the ability to checkout a commit and checkout the tip of any remote branch. You can now checkout any commit and go back to a previous point in your repository’s history to run or test your code. You can also quickly review pull requests and evaluate your team’s updates by checking out the tip of any remote branch.

Screenshot of Visual Studio's Git history view demonstrating the ability to checkout any commit

Screenshot of Visual Studio's Git history view demonstrating the ability to checkout the tip of a remote branch

For more information on the Git improvements in 17.1, take a look at Taysser’s blog post on the Visual Studio blog.

C++ enhancements for Embedded and RTOS make it easier to be productive

We’d also like to quickly remind you about the new visualizations for embedded registers and RTOS threads that we first described in the Preview 2 blog post.

You can access the registers view through Debug > Windows > Embedded Registers, which gives you a view of all the available registers, their mapped memory locations, and values.

Visual Studio's Embedded Registers window

Opening the RTOS Objects window through Debug > Windows > RTOS Objects gives you a view of threads running in the system along with their context.

Visual Studio's RTOS objects window

Be more productive with Solution Filters

Solution Filters allow you to choose what projects to load so you can avoid loading massive solutions every time. You have the choice to load individual projects or a project with its entire dependency tree. Our users noticed the dependency tree (and solution filter) can become outdated when new projects are added, or the dependency graph changes.

Visual Studio 2022 version 17.1 added an easier way to load the entire dependency tree for all the projects in the solution filter. This will pull in any new dependencies that were added to ensure you have all the projects you need. You can check for any new dependencies by clicking Update Project Dependencies in the context menu of the solution node in the Solution Explorer. Try this out and let us know what you think!

Screenshot of Visual Studio with the new Update Project Dependencies option highlighted

Support for Enterprise Customers

Now that Visual Studio 2022 version 17.1 has been released, our Professional and Enterprise customers have the option to manage the timeframe as to when they adopt the new feature set of 17.1. To stay on the 17.0 LTSC (long term servicing channel) and receive security and quality fixes – but not feature updates – for 18 months, follow the instructions on using the Update Settings dialog. Note that this feature is not available for the Community Edition.

By default, all installations of Visual Studio are configured to use the Current channel, which will receive the 17.1 feature set immediately. Alternatively, users and IT administrators can configure installations to defer the feature update in a secure manner until you’re ready to move forward. 17.0 LTSC will not receive additional feature updates but will receive security and quality fixes until July 2023. For a better understanding of how Visual Studio is serviced and supported, refer to the Visual Studio lifecycle policy. To configure the update channel, use the Update Settings dialog or do it programmatically via script or command line.

What’s next?

We’re also shipping the first preview of the second update to Visual Studio 2022, 17.2. The latest preview release of Visual Studio 2022 includes:

  • Bug fixes and improvements for .NET MAUI development
  • Continued enhancements in the Git experience
  • Support for new C# 11 refactorings, such as a new language feature called raw string literals
  • New capabilities for local development with your data using SQLite, Postgres, and MongoDB data sources

Chunk and line staging with Git

In the 17.2 Preview 1 release, you’ll see support in Git for staging chunks of stages in your files right from the editor. To enable line staging support, navigate to Tools > Options > Environment > Preview Features and check “Enable line-staging support”.

We’ll be sharing updates on Git improvements in another blog post very soon, so stay tuned!

Keep your code files in sync automatically

You’ll also find a new feature for automatically saving files when Visual Studio loses focus on the Tools > Options > Environment > Document page. This feature is available starting in the 17.2 Preview 1 release.

Screenshot of the Environment > Documents Options page showing the "Automatically save files when Visual Studio is in the background" feature

By selecting “Automatically save files when Visual Studio is in the background” on this page, any time Visual Studio loses focus, it will try to save every dirty document in the IDE including project, solution, and even other miscellaneous files.

We hope this feature proves useful and keeps it easier for those of you who use other applications in conjunction with your Visual Studio development to develop in multiple tools. We’ll be sharing more information on this feature in another blog post soon.

New C# 11 refactorings

In 17.2 Preview 1, a new C#11 feature, raw string literals, will allow you to convert a normal or verbatim string literal to a raw string literal. To use raw string literals, first set the language version in your project file to preview using `<LangVersion>preview</LangVersion>. Then, place your cursor on a normal or verbatim string in the editor. Finally, press CTRL+. To trigger the Quick Actions and Refactorings menu, then select “Convert to raw string”.

A screenshot of a computer Description automatically generated with medium confidence

To give the latest preview a try, look at the Visual Studio 2022 Preview channel page for more information. Note that you’ll be able to install it side-by-side with the 17.1 GA release. For full details on the 17.2 Preview 1 release, refer to the release notes.

Share your feedback and help us build a better Visual Studio!

As you use Visual Studio, let us know what you love, what you like, and where you’d like us to improve. You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.

As always, we appreciate the time you’ve spent reporting issues and hope you continue to give us feedback on how we’re doing and what we can improve.