Skip to footer content
Iron Academy Logo
C# Tools & Productivity

Comments the Easy Way in VS2022 v17.11

Tim Corey
4m 14s

In the world of code editors and development environments, Visual Studio continues to evolve by responding to user feedback and simplifying repetitive tasks. A great example of this is the improved commenting experience introduced in Visual Studio 2022 version 17.11. In his video titled “Comments the Easy Way in VS2022 v17.11,” Tim Corey walks us through this small yet powerful update that helps developers quickly comment and uncomment lines of code using a new shortcut.

In this article, we’ll follow Tim Corey’s demonstration step by step and explore how this update improves the workflow for developers using Visual Studio.

A Tiny Yet Powerful Update in Visual Studio

At 0:00, Tim begins by pointing out a tiny but impactful feature that was added to Visual Studio 2022. Specifically, version 17.11 now includes a new keyboard shortcut that lets you toggle line comments using Ctrl + /.

This simple command allows you to add or remove // at the beginning of a line—an action frequently used by developers working with various programming languages like C#, Python, or JavaScript. As Tim highlights, this improvement is all about making it faster to write, review, and edit your code, especially when dealing with large files or multiple lines that need to be commented out for testing or debugging.

How to Use the New Toggle Line Comment Shortcut

Tim dives into the new feature at 0:23, demonstrating how you can now press Ctrl + / to comment a single line in Visual Studio. If your cursor is placed anywhere on the line—no need to select the full line—you can simply use this shortcut to comment it out.

Pressing the same keyboard combination again will uncomment it. This simple toggle is intuitive and powerful, and as Tim explains, it mirrors the behavior found in Visual Studio Code (VS Code), where the same shortcut has long been available.

Many developers—especially those who switch between Visual Studio and VS Code—have requested this editor consistency, and Microsoft has finally delivered it in this latest update.

Version Check: Make Sure You’re Updated

At 1:07, Tim reminds viewers that in order to use this feature, you need to be running version 17.11 or later of Visual Studio 2022. Whether you’re using the Community, Professional, or Enterprise edition doesn’t matter—the feature is available on all platforms as long as you’re on the correct version.

You can check your version by clicking on the Help > About menu in Visual Studio. This is important if the shortcut doesn’t seem to work, as older versions won’t recognize the Ctrl + / toggle.

The Old Way: Ctrl + K, Ctrl + C

Tim then takes a moment to compare the new method with the traditional way of adding comments in Visual Studio. At 1:24, he demonstrates how developers previously had to use the Ctrl + K, Ctrl + C combination to add a comment, and Ctrl + K, Ctrl + U to remove it.

This method required holding the Ctrl key and pressing additional keys in a specific sequence—something Tim calls "awkward" at 1:56. Even after 20 years of using Visual Studio, Tim confesses that he never truly memorized that combination and often resorted to clicking the pencil icon in the toolbar instead.

Now, using the new shortcut, developers can quickly switch between commented and uncommented states without taking their hands off the keyboard or losing focus from their code.

Commenting Multiple Lines at Once

At 2:17, Tim shows how this shortcut works with multiple lines. If you select a block of lines and press Ctrl + /, each line gets its own // at the start. This form of block comments—using individual line comments instead of the traditional /* */—makes it easier to later uncomment only part of the selection.

This is particularly useful when debugging or testing different methods, functions, or sections of string or data output. Rather than wrapping everything in a block and then needing to remove it manually, you can comment and uncomment each line individually, even within a multiline selection.

Why This Matters: Responding to Developer Preferences

Tim emphasizes at 2:36 that this change, though seemingly simple, addresses a major frustration that developers have expressed for years. It aligns with the preferences of those who’ve grown accustomed to comments in VS Code, and it improves the context-aware behavior of Visual Studio’s text editor.

Even if you highlight only part of a line, the Ctrl + / command will still apply the correct syntax. It doesn't interfere with syntax highlighting, nor does it apply the wrong kind of comment formatting. Tim mentions at 3:01 that this feature includes smart logic that helps it behave consistently across different scenarios—whether you’re working with modified content or mixed comment states.

Smart Behavior When Mixing Commented and Un-commented Lines

At 3:30, Tim provides an example of what happens when you mix already-commented lines with uncommented lines. If you highlight them together and press Ctrl + /, Visual Studio will comment all of them—even those already commented—by adding another layer of slashes (////).

Pressing the shortcut again removes the outer layer, effectively toggling back to the previous state. This layered behavior avoids accidental loss of original comments, offering a more controlled and thoughtful approach to editing your code.

Try It Out and Save Time

Tim closes the video at 3:45 by encouraging developers to try out the new shortcut and see how much it improves their workflow. With such a smart and efficient solution, there’s no need to fumble through menus or use shift + click or extra tools just to comment or uncomment lines.

Whether you're working on a Windows platform, managing a complex file with dozens of functions, or trying to debug a single output line in a Python or JavaScript script, this update will help you stay focused and efficient.

Conclusion

In his video, Tim Corey walks through a small but impactful update in Visual Studio 2022 v17.11, reminding us that even the tiniest changes can make a developer’s life significantly easier. The addition of a simple, intuitive toggle line comment feature using Ctrl + / brings Visual Studio in line with VS Code, aligning with user preferences and modern coding practices.

If you're a developer working in Visual Studio, be sure to update your editor and add this shortcut to your everyday toolkit. Whether you're writing, reviewing, debugging, or just experimenting with different blocks of code, this is truly the best way to manage your comments quickly and efficiently.

Hero Worlddot related to Comments the Easy Way in VS2022 v17.11
Hero Affiliate related to Comments the Easy Way in VS2022 v17.11

Earn More by Sharing What You Love

Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!