May 172011
 

 

I often work on various branches of the same project (using TFS). This means that I have folders setup like:

[root]/Project

[root]/Branch A/Project

[root]/Branch X/Project

Sometimes I have to keep multiple Visual Studio instances open at the same time with branches of the same project and because by default VS2010 only displays the solution name in the title bar, switching between different windows can become very confusing.

A very simple solution to this problem can be used by installing the VSCommands extension (Tools –> Extension Manager –> Online Gallery –> Search for “VSCommands”).

After installing the extension (and restarting the IDE), go to Tools –> Options –> VS Commands 2010  and select IDE Enhancements. Scroll down the options until you find the group called “Solution”. You should see there two textboxes:


image thumb Display branch name in Visual Studio 2010 title bar


In the “Friendly Name” field input the following text: {solutionName} – {branchName}

In the “Friendly Name – Solution Path Regex” field input the following text: .*\(?<branchName>.*)\(?<solutionName>.*.sln)

Press OK, and voila! in the IDE title bar you will have a title like “Project – Branch A”.

 Display branch name in Visual Studio 2010 title bar