Visual Studio 2022 tip: press Shift+F2 to add any file, fast

Posted: (EET/GMT+2)

 

Earlier this year, Microsoft made available Visual Studio update 17.5 which, among other things, contained support for a feature called "Quick Add Files & Folders". This is like the regular "Add New Item" dialog box, but a more compact version.

The compactness is not the main feature, but the fact that the file extension tells Visual Studio what kind of file you want. In the compact version, which can be opened with the new keyboard shortcut Shift+F2, does not need you to select the type from a long list. Instead, you just type the filename with the extension (such as .cs or .ts) and Visual Studio will create the file for you in the correct type.

Very handy! So next time you need to add a new file to your .NET project, try pressing Shift+F2 and see where it takes you.