Do you have large Visual Studio solutions with many projects? Are you looking for an easy way to hide some projects while working on others? Maybe you are a fellow speaker looking for a way to group and organize your demo files? Solution Folders may be what you are looking for!
What are Visual Studio Solution Folders?
In Visual Studio, you can add virtual folders to group and organize your projects and files. Folders can be nested, collapsed, expanded, and even hidden in the Solution Explorer. Please keep in mind that these folders are entirely virtual. That means that you will still have to physically organize your projects the way you prefer in your file system.
Create Solution Folders
Right-click on the solution → Add → New Solution Folder (or with the solution selected, click the Project menu → Add New Solution Folder):
Hide Solution Folders
Right-click on the folder → Hide Folder (or with the folder selected, click the Project menu → Hide Folder):
Show Solution Folders
Right-click on the solution → Unhide Folders (or with the solution selected, click the Project menu → Unhide Folders):
Example: Organizing My Demo Projects
I presented my first ever session in 2014. Back then, I only had a single project with a few demo files - not much to organize 😄 Over the years, I created several new sessions and a full-day workshop. With each session, I created new projects. I like to keep all related projects in one solution, but this solution is now getting pretty big!
My solution makes sense to me, but it looks absolutely overwhelming to my attendees. (“What do you mean this stuff is simple and timesaving… You have fourteen projects in there!”) If I have to spend precious time explaining that “these demo files are available for you to download, but please ignore them for now” - I’m doing something wrong. It is my job as a presenter to guide attendees through my session, not their job to ignore everything that is irrelevant.
Before and After Adding Solution Folders
One way of helping my attendees stay focused is to re-organize my projects into Solution Folders. By doing this, I can hide the folders that are irrelevant to the session I’m presenting.
Before: 14 projects in one solution, and most of them were only relevant for my full-day workshop. This looks overwhelming!
After: Four Solution Folders added: One for each regular session, and one for the workshop. It is already looking much better. I can also hide the folders that I know I’m not going to show. This will make it easier for attendees to focus on what I’m presenting, instead of trying to understand what those other 9 projects are 😅
Scoping to Solution Folders
An alternative to hiding folders is to focus on a single folder. I can use the Scope to This option to only show that folder in the Solution Explorer. Right-click → Scope to This:
Now I only see the contents of that folder. I can click the back button to go back to the full solution view. Yay!
(Confession: I’m never happy with how my demos are organized! Looking at this, I know that I will most likely be renaming and moving things around. Adding Solution Folders is a great first step to re-organizing my demos. For a pedant like me, the best part is that these folders are virtual. That means I can move things around as much as I want without breaking anything.)
In this post, we looked at how to organize Visual Studio projects by adding Solution Folders. These folders are virtual and can be nested, collapsed, expanded, and even hidden in the Solution Explorer. By adding Solution Folders, we can make it easier to focus on specific projects by hiding or scoping to folders.
About the Author
Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, organizer, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, coffee, chocolate, and cats 🤓