views:

65

answers:

1

I have a solution which has many projects inside it. I build the solution and have some compile errors. Double clicking an error will open a class file, called FileA.cs. What I don't know how to do is viewing FileA.cs in the Solution Explorer pane. Please help!

+1  A: 

You have 2 options without macros, either always enable tracking, or bind a key to toggle it:

If you want to always enable tracking: Enable the Track Active Item in Solution Explorer option, but note there's some performance penalty is leaving this on. Get to this by Tools > Options > Projects and Solutions > General

Alternatively, bind a key to turn this on and off (but you'll have to hit it twice).

Third, macro option, make this macro and bind to a key so you don't have to hit it twice to disable it:

Sub FindInSolutionExplorer()
 DTE.ExecuteCommand ("View.TrackActivityinSolutionExplorer")
 DTE.ExecuteCommand ("View.TrackActivityinSolutionExplorer")
End Sub
Nick Craver
Why do we need to do it twice?
Nam Gi VU
@Nam Gi VU - Just to turn it back off if you don't want the performance penalty. If the performance isn't bad for you, you can just leave it on.
Nick Craver
I see. Thank you Craver!
Nam Gi VU