Skip to main content

Track Files in Visual Studio

By default, Visual Studio’s Solution Explorer will update its selected item based on the currently active document. This is extremely annoying as it keeps expanding your projects and folders until your solution explorer becomes unmanageable and unusable, unless you collapse all Projects (Only available if you have Visual Studio Power Commands) installed) and even then, after collapsing the entire solution, the saga returns back.


Turn off Active tracking

1. Turn your Active tracking off by going to Tools > Options
2. Select “Projects and Solutions” node
3. Uncheck the “Tack Active Item in Solution Explorer”


Add a macro to do on-demand tracking

4. Tools > Marcos > Macro Explorer
5. You will see “MyMacros” Module (Node). Right mouse click on MyMacros and invoke “New Module…”
6. Name it anything you like. I Named it Utilities
7. Right mouse click on Utilizes and invoke “new Macro…” menu. The Macros IDE window opens.
8. Paste in the following into it within the Public Module Utilities statement

Public Sub TrackProjectItem()
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer", True)
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer", False)
DTE.ExecuteCommand("View.SolutionExplorer")
End Sub

9. You Macro should look like this.

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90

Public Module UtilitiesPublic Sub TrackProjectItem()
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer", True)
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer", False)
DTE.ExecuteCommand("View.SolutionExplorer")
End Sub
End Module

10. Close the Macros IDE Window
11. Right mouse click on MyMacros node within the Macros explorer window and make sure “MyMacros” check for “Set as Recording Project” is checked.
12. Now, bind this macro to a shortcut key of your choice.
    a. Invoke Tools > Options, and Select “Environment” > “keyboard “ node
    b. Type in Macros into the “Show command containing” edit box. Navigate to your macro Macros.MyMacros.Utilities.TrackProjectItem
    c. Put your cursor in the “Press shortcut keys” edit box and press whatever shortcut key you desire. I used F1 since F1 mapped to Help is useless.

'
d. Press “Assign”.

Comments

Popular posts from this blog

WCF Dos and Don'ts

Do not inherit interfaces from other interfaces. Interfaces are contracts. Contracts must be explicit, otherwise the flexibility and maintainability of your design would run into issues. An interface is a pure contract definition and should remain explicit and pure. Consider the following example: [ServiceContract] public interface IMyService1 { [OperationContract] void Test1(); } [ServiceContract] public interface IMyService2 : IMyService1 { [OperationContract] void Test2(); } [ServiceBehavior(…)] class MyService : IMyService2, IMyService1 { #region IMyService2 Members public void Test2() { } #endregion #region IMyService1 Members public void Test1() { } #endregion } What happens when you Publish your Service and open its communication channels. If you do the following: ServiceHost serviceHost = new ServiceHost(typeof(MyService, …) ServiceEndpoint ep = serviceHost.AddServiceEndpoint(typeof(IMyService1), typeof(IMyService2)); You will get

How to turn off the annoying adobe updater

Mainly for peole who only installed adobe reader, this becomes an annoying intrusive behavior. Who cares about the updated version of Adobe. 1- Run Adobe Reader 2- Invoke the "Edit" > "Preferences" menu 3- Select the Updater node at the bottom. 4- Select the "Do not download or install updates automatically" 5- Press OK. Done!!!!!!!!!!!! Phew

TF31001 error when connecting to TFS 2010

The Server returned the following error: 246021. An error occurred while processing your request. Technical Information (for Administrator): SQL Server Error 1934 (retry) This error is caused due to SQL Server Server settings of "noCount" and/or "numeric round about" being turned on. Run ssms.exe, right click on the SQl Server node, and invoke the Proerties dialog. Select the "Connections" node, and turn off both items.