How To See Project Files In Visual Studio For Mac

Posted on

When I think of things that annoy me the most in Visual Studio's IDE, the Project New Item. Dialog and how it works has to rank at the top of the list. Adding new files to a project is a common task and honestly I think much of the criticism leveled at Visual Studio from non Visual Studio developers who first use Visual Studio can be traced back to the convoluted way of adding files to a project. So, here are a few annoyances and a few tips to make adding new items to a project more bearable.

New Item or New File? Do you use New File or New Item? And why are these options buried? The File menu only shows New File which is the obvious place to look, but very likely the wrong choice, when you really want the New Item dialog. By default the New File. Dialog which you want to use most of the time, is not mapped to Ctrl-N as you would expect either - no, that obvious shortcut goes to the New File dialog which creates a new file that is not added to the project.

Useful in some cases, but generally not applicable when you're working on a project. The New Item feature is probably the most used context menu action you use at the project level, yet the New Item option is buried in a secondary menu: The Add. Option is buried in the middle of the context menu where it's hard to see (because the text is short), and then the New Item.

In Visual Studio, we usually work with project files (which contains list of files) rather than folders. I suppose you are a webdeveloper, since folder based project are typical for web development. “File -> Open -> Web Site” is equivalent for Open Folder in Visual Studio. Visual Studio has a boat load of ways to add new files to a project and various extensions and tools provide even more ways to do the same. Even so the experience to add new files to a project in Visual Studio is one of the most tedious tasks.

How To See Project Files In Visual Studio For Mac

Option is one level down beyond that. If you're mousing there - it's a pain. To me it seems the New Item. Option should be at the very top of the first context menu - not nested - so you don't have to hunt for it. Can still be there for all the other options, but that New Item deserves a more prominent location. You can also find New Item.

On the Project menu with Project -> New Item which is a bit easier to discover. But then nobody really looks up there, do they? Remapping Ctrl-N to the New Item Dialog Then there are keyboard shortcuts. As mentioned the default short cut for New Item is not Ctrl-N. I'm not sure because of keyboard remappings that happen mysteriously by various installed extensions, but for me the New Item. Option does not have any key association.

Visual

The obvious key - Ctrl-N - is mapped to the New File. Dialog, which although similarily named does something completely different. Unlike New Item, the New File dialog opens a new file loose file and doesn't add it to the project. New Item opens a new file and automatically adds it to a project and creates dependent files, adds references etc.

That are related to the underlying file template used. Now I would much prefer Ctrl-N is always mapped to New Item. You can fix that easily enough though in the Visual Studio options: You just have to make sure that you don't have a key mapping conflict and that nothing else tries to highjack the combo later. Settings Looks like Visual Studio 2017 defaults Ctrl-N to New Item. As you'd expect. Use Ctrl-E to jump to Search in the New Item Dialog Another annoyance is that the New Item Dialog comes up with the tree of high level options selected on the left.