Adding new files just got a lot faster
Have you ever felt like the New Item Dialog slows you down when you want to quickly create an empty file or a simple C# class? Browsing through a list of templates is sometimes necessary, but wouldn’t it be great if Visual Studio could figure out which template you needed based only on the file name?
If you answered yes, then you’ll want to use the new Quick Add Dialog! To get started being more productive with less clicking, download the latest preview version of Visual Studio:
Try out the Quick Add experience
Once you have the latest preview, give the new Quick Add feature a try by opening any solution. Right click on a folder or project and select Add > New Item… or type Ctrl+Shift+A, just as in the past. Instead of the old New Item Dialog, you’ll see the Quick Add Dialog!
With the quick add dialog, you can:
- Add a new file without browsing through the template list:
- Create nested folders in a single operation:
- Add files with any extension, or no extension at all:
File.MyExtension, README, .gitignoreTIP: Quick Add prepopulates a default extension for you, but you can hit Escape after opening the dialog to quickly clear the input box.
- Add multiple files at once:
File.(cs, txt). The first example will create a File1.cs and File2.html. The second example will create a File.cs and a File.txt.
You can also quickly switch between the Quick Add Dialog and New Item Dialog. Visual Studio will remember your choice, so you get the experience that suits your needs best! And if you’d like to return directly to the Quick Add Dialog regardless of previous state, you can type Shift+F2. Keyboard shortcuts are configurable in Tools > Options > Environment > Keyboard.
- Use “Show All Templates” to open the New Item Dialog
- Use “Show Compact View” to open the Quick Add Dialog
We want your feedback!
Quick Add is inspired by the Add New File extension. If you liked Add New File, we want you to love Quick Add! Quick Add adopts the same keyboard shortcut Add New File used, so you don’t have to memorize a new one.
If you’re interested in this feature, install the latest preview version of Visual Studio and try it out! Note that we’re still tuning the algorithm that chooses a template based on the project type and the file name you entered, so please let us know how we can improve it. Share your thoughts with us on the Add the extension “Add new file” as baseline ticket on Developer Community and vote by clicking thumbs-up/thumbs-down in the dialog.
Finally it’s built-in feature (it was previously available as “Add New File” extension)!
Please have it turned off by default. This is just confusing when I’m trying to teach new folks how to add new files. The implementation works well if you only ever add a single type of file (e.g. class) but doesn’t work if you need any other item template (and using some sort of encoding scheme to find other templates doesn’t seem easier than just using the UI). In my experience I use a mix of item templates so this isn’t a useful feature but I have to turn it off first (and teach others to do the same).
All this is just to solve the underlying issue that finding item templates in the new UI is awful and the recent templates selection isn’t helping solve the problem either. Maybe you should consider improving the UI so it is faster and easier to find templates (perhaps just grouping them like it used to do in the pre-start window days) rather than adding a quick add function.
Visual Studio used to be a well thought through product. The feature set was a carefully selected balance between useful productivity, high quality and bloat.
Not any more. It’s now a complex mess of features, while the fundamental tools such as the debugger are not nearly as useful as they were in the past.
It mentions in the blog post that you can click on the “Show All Templates” button, and then it’ll remember your choice in the future (so when you go to add a new item in the future, it’ll automatically show the full template list like before). I can see how it’s annoying when you have a workflow/instructions already in place, but one extra button click isn’t too much of a change on its own.
What slows me down is not adding new files, but the almost useless VS Debugger in mobile projects.
Most of the time I get the External code stack (which ends up being a XAML issue I’d have to find myself) or just get directed to a platform-specific Main program entry.
To the point when I have to pepper the code with diagnostics prints rather than just using the debugger. THAT’S what slowing me down but that’s a harder issue for the VS team to tackle than providing yet another way to add a new file to the project.
In the golden days of MSFT developer tools (10 or so years ago) the debugger was the star of the show, now it’s below average at best.
I have nothing against Linux or Mac…I like Linux, but don’t use a forward slash. This is Windows where almost everything is back-slash; don’t be ashamed of it…I’m not.
Windows supports both forward and back slashes, so why not use the notation that works everywhere? I might be adding a file to a project stored in a Linux filesystem inside WSL – even if I’m using Windows, there’s no guarantee that the backslash will work, but there is a guarantee that the forward slash will work.
Also, the forward slash is objectively better as a directory separator character, because it doesn’t have to be escaped when representing a path as a string.
Is this handy dandy feature not available for Community edition as the usual template dialog appears upon Add :: New Item …
This feature is in preview and therefore you need the Preview version of VS. There is no “Community” version of Preview because it is basically the Professional version with a time limit. You can download the preview version of VS from the link given in the blog. It is fine to have both versions installed at the same time but note that most configuration is not shared between versions so you’ll need to reinstall any extensions you might want. Your personal settings like themes are shared but it is hard to know what is and isn’t.
Note however that Preview versions are potentially buggy, have other features in preview that can break things and may be slower. So don’t get too upset if you have made a lot of changes and VS suddenly crashes and wipes everything out…
This is definitely a huge productivity boost for devs. While Mads’ Add New File extension was great, what it missed the most was support for built-in VS Templates. I actually implemented the feature  at one point which got merged in the extension initially. However, during some refactoring (I assume), the feature again got dropped off the main branch which led me to create a fork called “Fast New File”  that retained the feature. However, since then I had moved on to use a Mac and an alternate IDE that I didn’t maintain the fork either 🙈
It looks like the built-in feature does have template support. Does it apply the template by extension? Does it honor conventions (like ISomething.cs would get the C# Interface template)?
If I need to add new class I just write it besides some existings and use refactoring – Extract To Separate File. IMO, it’s more useful to have all classes in one file when you just sketching out prototype for some features.
If I need to add something more complicated, like XAML class from template I will have to use old “Add Item” menu.
However respect for UI improvement endeavors.
I agree, this is the way I go. It auto-copies all the file headers, existing using statements, namespace declarations, etc without issue. However I have 2 of these options (one from another extension) and one of the options ignore the namespace syntax preference (I believe the extension) whereas the other one (the built in one I think) does recognize that I want the simplified namespace syntax instead of namespace blocks. I don’t know that the template can figure all that out so this approach is faster for simple types like classes, interfaces, enums, etc.
Awesome. Adding a simple JSON file no longer be 10+ clicks! Rejoice!
Thank you for the information, Happy Holiday
awesome tool, any way to make the file accessor public by default when creating classes???
You can edit the class template file:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs
This allows you to change the class to public, namespace imports, add copyright headers, etc etc…
Note: File path must be adapted to VS edition and installation folder.
Im on 17.5.0 Preview 2.0 but i cant use this feature yet.
Meaning it doesn’t show up? It is only available if you right click a project\folder in Solution Explorer and then select `Add \ New Item`. It should then show you the minimal UI. If it jumps straight to the full view then it is possible you “disabled” it earlier. In the bottom left corner of the UI there should be a “Show Compact View” option to switch back to the minimal view.
If that isn’t available then I wonder about the project type you’re using (e.g. C# console, C++ library, etc). Not sure if this feature requires anything from the project type that is loaded.
Finally a little “de-bloating” happening. It is super annoying to Add an item, then have to wait for a long list of template options to appear, all just when I want to add a simple .cs class file. This is the type of behaviour that should be standard and not a “new feature”. None-the-less, good work!
I want the same support for .templates folder as extension has.
Quick Add isn’t using any template.
Never had any issues with Mads’ extension.
Now, after updating my Visual Studio 2022
CTRL+SHIFT+A opens the full add dialog – creating a Whatever.cs file uses the Class template, as expected.
SHIFT+F2 (my shortcut for the extension) opens the quick add dialog – but creating Whatever.cs just opens a new completely blank file.
I’ve tried disabling then uninstalling the “Add New File (64-bit)” extension, but still same behaviour.
How do I disable the “built-in” and go back to my “was working perfectly fine before” extension version?
What kind of project are you seeing this behavior in?
Es ist total umständlich, mit eurem “Add New Item” – Dialog. Weshalb kann man nicht einfach eine Datei anlegen, z.B. wie in VSCode mit STRG +N. Dann schreibt man den Dateinamen hin, drückt RETURN und ist in einem schönen leeren Editor.
Macht es doch bitte einfach so, dass man diesen Template-Dialog deaktivieren kann.
Wer gerne viel mit der Maus rumklickt und auch Spass daran hat, den unpassenden Template-Code umzuschreiben oder sogar ganz zu löschen, der kann sich das dann ja explizit aktivieren.
Ist es nicht fragwürdig, dass ich erst ein PlugIn installieren muss, um ein überflüssiges Feature wieder loszuwerden? Andersherum wäre es logisch – ich installiere ein PlugIn, weil ich das Feature möchte.