The example code is written in VS 2010 but will work fine is VS2012 as well. Get it from the Visual Studio Gallery here.
Compare to Branch reduces the process to just 2 mouse clicks. The ability to compare across branches was always available to TFS users by using the compare dialog but the number of button clicks to do it was too much I thought. I wrote it to try and help me better visualise the differences between a growing number of released and supported versions of a project I am working on at the moment. Just right click on an item in the source control explorer and a list of branch related items appears in a popup allowing you to easily compare that item across branches. A Complete Example - The Find in Solution Explorer Add InĬompare to Branch is an add in I wrote for Visual Studio 2010/2012 and TFS 2010/2012 that lets you easily compare files and folders across branches in Visual Studio.There is a fully worked example in the code that uses all the elements discussed here, hopefully this will provide a template so others can just focus on implementing functionality. I came up against these things when creating the Compare to Branch extension for Team Foundation Server and wanted to share my experience here so that others don't have to go through the same head scratching I did. Things like, UI not being created, UI not being updated or being created multiple times in the same menu. I think that there are however a few important subtleties and concepts that are not made clear and that you should be aware of when creating an add in and want to provide a smooth and problem free user experience. Creating an add in is simple using the wizard, just make a few selections and Visual Studio sets up the solution and adds an example button to the tools menu, you just fill in the blanks to execute your code. They aren't as cool as their big brother, Visual Studio packages and you get a lot more control with packages but they do provide a quick and easy way to get your functionality out there. Visual Studio add ins are a very quick and easy way to extend the functionality of Visual Studio. Download AddIn_-_Examples.zip - 42.1 KB.