Visual Studio Tips and Tricks: Increasing your Productivity for .NET

August 27, 2019

Mika

August 22nd, 2019

The .NET team is constantly thinking of new ways to make developers more productive. We’ve been working hard over the past year to take the feedback you’ve sent us and turn it into tools that you want! In this post I’ll cover some of the latest productivity features available in Visual Studio 2019 Preview.

Code Fixes and Refactorings

Code fixes and refactorings are the code suggestions the compiler provides through the lightbulb and screwdriver icons. To trigger the Quick Actions and Refactorings menu type (Ctrl + .) or (Alt + Enter). The list below contains the code fixes and refactorings that are new in Visual Studio 2019 Preview. We’d like to give a big thanks to the community for implementing and reviewing many of these! Wrap call chainYou can now wrap chains of method calls with a refactoring.

Rename a file when renaming a classYou can now rename a file when renaming an interface, enum or class.

Sort usings is back!We brought back the sort usings command separate from the Remove and Sort Usings command. You can now find the Sort Usings command in Edit > IntelliSense.

Toggle comment/uncommentToggle single line comment/uncomment is now available through the keyboard shortcut (Ctrl + K, /). This command will add or remove a single line comment depending on whether your selection is already commented.Toggle block comment/uncomment is now available through the keyboard shortcut (Ctrl + Shift + /). This command will add or remove block comments depending on what you have selected.