Thursday, 16 January 2014

Comparing two Shelvesets

Ever been in a situation where you have created a shelveset for a colleague to review or extend and he/she has created another shelveset for you. It’s often quite time consuming to find out the changes made on top of your shelved changes. The way to compare contents is to unshelve one of them and then compare the files in other with the workspace version of the files. This is not ideal especially if you have already got some other pending changes as well.

Since, neither Visual Studio nor Team Foundation Server Power Tools provides this functionality, I thought it would be useful to create a visual studio extension to allow comparing two shelvesets. Have been meaning to do it for some time but only found time to create one. The extension is now created and published in the visual studio gallery. I have made it an open source project and the source code is available at

Once installed the extension appear as a Navigation button in your Team Explorer window.


Clicking on the button will open up the “Shelveset Comparer” window showing your shelvesets in the default view


You can type another person’s name to fetch his/her shelvesets. Once you have selected the two shelvesets, click the “Compare” button and it will list the files in the two shelvesets side-by-side. It also does a binary comparison of the common files to review if they have the same content or not.


Double click on any file and you will see the contents of the selected files with the changes highlighted.


Please note that the file comparison is only for reference. None of the two files shown in the comparison window are downloaded in your workspace or is the working version of the file.

I hope this extension is useful for the developers community and am looking to hear back with your feedback and suggestion and of course if you want to contribute, please drop me a line. Happy coding!!


Nikolaj Hesselholt Skov said...

This is great! Just what my colleagues and I are missing. Does it work with Visual Studio 2010? We have not yet upgraded to 2013...

Hamid said...

Thanks Nikolaj,

It's only supported for VS2012 and VS2013 only I am afraid. VS extensions are very different in VS2010 and I don't have plan to support it at the moment. If you have got access to VS2012 or VS2013, you can just use the team explorer and use the extension.

Sasha said...

Just installed for VS2012 and getting following message:

The "ShelvesetComparerePackage' dodn't install correctly.

ActivityLog.xml shows this on my machine

CreateInstance failed for package [ShelvesetComparerPackage]
Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Hamid said...

Hi Sasha,
Thanks for reporting this. It was an error in the latest release. We consolidated code base for Visual Studio 2013 & Visual Studio 2012 version and missed out this reference.

The fixed is now available at

Please download it and let me know

Ravi Vaddadi said...

I use VS 2012 Professional edition and I do not see the "Compare Shelvesets" navigation link. Does it support only the premium version?

Hamid said...

Hi Raj,
The link would be with in the "My Work" section. Please see screenshot here

Ravi Vaddadi said...

My Work appears only when you have installed Visual Studio Premium or Visual Studio Ultimate.

I m using Professional edition.

Ravi Vaddadi said...
This comment has been removed by the author.
Hamid said...

Oh, you are right. That's a shame. I didn't realise that.

I will get another release out this weekend moving it to the Pending Changes section. Would that do?

Hamid said...

Hi Ravi,
I've updated the extension so that "Compare Shelveset" link appears in the Pending Changes. Please refresh the extension and you should be able to use it.

I hope it works well for you and please give your feedback:) Thanks

Ravi Vaddadi said...

Thanks Hamid. It works like a charm.

TomasK said...

It does not work when you need to select two shelvesets with different users. There is no possible to select the second shelveset. The second text box does not display the list of shelvesets.

I am using the Microsoft Visual Studio Premium 2013 - Version 12.0.31101.00 Update 4

Hamid said...

Hi TomasK,

If you go to Options tab, you would see the option "Select shelvesets from two users". Please make sure it is checked for you. I have the same version of Visual Studio and the version 1.4 of the extension works fine for me.