Forced Solution Explorer decision to select a file in an editor in visual studio 2005

In Visual Studio 2005, whenever I look at a file in the main editor, Solution Explorer will find and highlight this file. Some time ago, it stopped working, and Solution Explorer did nothing.

This has become a real pain, as the Go To Definition chain can lead you to your decision. Where is the setting to enable this?

+43
visual studio
Aug 27 '08 at 20:22
source share
6 answers

Click "Tools" → "Options." Select the Projects and Solutions page → General Settings.

Make sure the "Track Active Item in Solution Explorer" checkbox is selected. That should do it.

+63
Aug 27 '08 at 20:24
source share

I like to disable this option (especially when working with a large project), but it is useful in order to find a file in the tree from time to time. I found a way to do it here .

Hope I'm not too verbose, but here is the guide to creating this work that I wrote for my wiki:

  • Go to Tools-> Macros-> Macro Explorer.
  • In the macro explorer tree that appears, right-click MyMacros and then the new module ....
  • Call the new SyncItem module (if you want).
  • Right-click the new module, then select Modify.
  • Paste this into the code window. (I do not know and do not care about whether import strings are needed, they are by default only there.)

the code:

Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Public Module SyncItem Sub SyncSolutionExplorer() DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer") DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer") End Sub End Module 

A macro is most useful if you bind it to a keystroke. Here's how to do it:

  • Go to Tools-> Options, then select "Environment-> Keyboard".
  • Find the new macro in the list (start typing "syncitem" or similar in the search field).
  • I choose Alt - Shift - T (which likes to call this dialog box Shift - Alt - T ) for, um, "Tree", I think? If you're a fan of Edit.LineTranspose , whatever it is (I think it changes the current line as follows), then you might like to choose a different shortcut.
+34
Sep 05 '08 at 16:17
source share

I just discovered that ReSharper can do what Owen offers. I turned off “track active item in Solution Explorer”, and when I work in the source file, I press Shift + Alt + L and the file is selected in Solution Explorer. I did not change the binding, so I think this is the default value. The surface of this is that you do not need to create a macro and then bind it to a keystroke (although this is not very difficult, it still needs to be done). The downside is that ReSharper is not free, so this is probably not a solution for everyone.

+16
Aug 18 '09 at 18:43
source share
  • Go to Tools -> Options
  • Select "Projects and Solutions" in the tree structure on the left.
  • Select "Track Active Item in Solution Explorer"
+13
Aug 27 '08 at 20:24
source share

Tools-> Options-> Project and Solutions-> General Information

Check the box next to “Track active item in Solution Explorer”

+3
Aug 27 '08 at 20:26
source share

Tools → Options → Environment → Keyboard

Assign a team

View.TrackActivityinSolutionExplorer

(I use Alt + L)

then to use always press Alt + L and then Alt + L

which enables the function and finds the file in the source tree and then disables it again to stop the location bouncing around when you don't want it.

+2
Nov 14 '11 at 16:42
source share



All Articles