Visual Studio 2012 New Features: Solution Explorer
I love the title of this one because I’m sure someone will read this and wonder why I think Solution Explorer is a “new” feature. I mean, haven’t we had this sucker for a billion years? Aren’t there cave drawings in France about this feature? So why is it “new”? Let me show you!
Search Solution Explorer (CTRL + ;)
First and foremost, you can now search Solution Explorer! I’ve been wanting a feature like this since before Solution Explorer was even invented back in my VB 3 days (about 19 years ago). Here is what things looked like back then:
And from then until Visual Studio 2010 we STILL couldn’t search items:
But now you can! Just type in any search term into the Search Solution Explorer textbox:
And it will find anything that contains the search term in it:
You can filter the search to choose how broad the search goes by clicking on the drop down arrow to the far right of the Search Solution Explorer textbox:
(NOTE: searching within file contents doesn’t mean what you think it means. See the section “More Than Physical” for information)
One other cool feature is you can have Solution Explorer only show you the currently open files by clicking the drop down button just to the right of the Home button:
More Than Physical
In the past, Solution Explorer was relegated to only showing physical elements or those things that help contain / organize those elements (i.e. solution folders). That’s out the window, too. Now the experience doesn’t stop at the physical level but extends to logical elements as well:
Which makes searching even more awesome:
If you are using the Preview Tab then clicking on any item in Solution Explorer will go to the file and highlight code if applicable BUT you can’t double click the logical item to open the file for some reason and instead have to double click the filename to open it.
Navigation
Navigation is much improved as well.
Browser-Like Movement
After a doing a search, like the one shown above, you can click the Home button:
And Solution Explorer will go back to “normal”:
Clicking the Back button:
Takes me back to the search I just did:
Here is the weird part: If I reuse the search box and type another search right away it doesn’t remember the previous search I did and I can’t go back; BUT if I click Home between searches then it remembers all my old searches. I’ve tested this up to 12 entries and it works fine as long as you remember to click Home between searches.
Sync with Active Document
Occasionally you may be looking at a file but Solution Explorer isn’t on that file. When this happens a button appears that allows you to sync Solution Explorer with the document you are currently in so you can see where it is in the project structure.
Right Click Experience
The right click experience is, to say the least, incredible! Depending on what you select the context menu changes appropriately. So if I right click a code file this is what I get:
But if I right click a class this is what I get:
And this is the context menu for a method:
Each option changes the view in Solution Explorer to better examine relationships. The bottom line: make sure to check out your context menus to change the elements you are viewing in Solution Explorer.
New Solution Explorer View
There used to be a button for creating a new instance of Solution Explorer which was excellent for multi-monitor viewing of code:
The button is gone now (which is a mistake in my opinion) and you can no longer get an entire copy of Solution Explorer in a new window BUT you can get a copy of any project or file in a new Solution Explorer window which is what I have done in the example above. Just right click any project/file and choose New Solution Explorer View:
Team Foundation Server
If you are using TFS then you can filter Solution Explorer to show you files with Pending Changes:
And there you have it! As you can see there are quite a few changes in the new, improved Solution Explorer so go explore!
Comments
Anonymous
June 21, 2012
Excellent article with many "big" ( in size + 1 for you ) screenshots making easier to understand what you are writing ( english is not a mother tongue... )..I have apprecaited especially the part about the Navigation part which introduced great improvements. Many thanks to have accepted to lose time to share all these valuable informations.explained in a so simple and clear wayAnonymous
June 21, 2012
Hey Papy :) Glad you like the article :) ZAnonymous
June 21, 2012
woot! Actually I wanted to blog about this but I think your summary comes close to what I wished to state. When I checked out VS2012 for the first time, that's the first thing I saw and was like .. wow!Anonymous
June 22, 2012
So coooooooool, i wish my company didn't make me works under Emacs or VIM :-(Anonymous
August 10, 2012
Good move, it looks like it's the VS2010 SolutionNavigator [1] replacing SolutionExplorer and adding new features. I think sync can be very helpful. What about the multi-document icon next to the refresh button? I hope it's the collapse all feature. This leads me to the next question: What's the purpose of the refresh button? [1] blogs.msdn.com/.../solution-navigator-blog-post.aspxAnonymous
October 24, 2013
And the right click experience, OMG!!!, best experience ever.Anonymous
November 19, 2013
The comment has been removedAnonymous
November 27, 2013
How do I persist multiple Solution Explrer views? I've got a lot of libraries and projects in my solution so I usually open up 2-3 solution explorers and reduce them to a specific scope. I can't get them to persist however.. every time I reopen VS they are just GONE. VS 2012 update 3.Anonymous
May 22, 2014
Where Can I find the meaning of each icon in solucion explorer, currently there are a lot of differents icons. dónde puedo encontar el significado de cada ícono en el solución explorer?Anonymous
June 15, 2014
For anyone who has used a Jetbrains editor ehm... VS misses too many functionalities LOL it's like using notepad!Anonymous
June 15, 2014
John :) I obviously disagree with the exaggeration but I definitely like having Resharper in Visual Studio. ZAnonymous
October 15, 2014
i closed solution explorer but now i am not able to search solution explorer..please help meAnonymous
November 15, 2014
I like the "New Solution Explorer View" What would be even better would be if we could select multiple projects and then select New Solution Explorer View and have the new tree only display those projects. Allowing you to focus only on the projects you are working in. I can sort off achieve this now by creating a Solution Folder called say "Working" and then moving projects into there temporarily. I can then use New Solution Explorer View on the "Working" folder. The issue here is that you have to remember to move the projects back to there original location before you check-in.