Tuesday, May 24, 2011

Finding active file in Vistual Studio 2010 solution explorer

I often use Ctrl-, (control comma) or another search variant to locate files when I'm working in Visual Studio 2010. Unfortunately, it often leaves me with a bunch of open windows and no easy way to navigate to the project, directory, or other tree area within my solution where the file actually lives. The pop up search box often gives the path, but it is still a nuisance to go expand a bunch of "+" signs to go find it. I knew there had to be an easy way.
As it turns out, there is. Visual Studio has an option (Tools > Options > Projects and Solutions > General) called "Track Active Item in Solution Explorer" that will automatically update the solution explore to hop to the file that is active.
The downside, of course, is that it ALWAYS does this. I originally found the feature via another post that tells how to create a macro to do this on-demand: [locate-file-in-solution-explorer-visual]. Now I just have to figure out how to add a macro to vStudio. :-)

Happy coding.

1 comment:

  1. Thanks! I got here through Google, looking for a way to do just this.

    ReplyDelete