Scott

Scott Hudson's Blog

Visual Studio 2012: Suspend and Resume Work

Is suspend just the new name for Shelving?(The method of checking items into TFS outside of the main build in versions of Visual Studio prior to 2012) Well not quite, it's more like shelving ultimate edition but it comes with Visual Studio Professional and Ultimate!

So what does it do? When you are working on a particular piece of work and for whatever reason need to drop everything you're currently doing and start a new piece of work. You don’t want to check in unfinished work and potentially break the build and there's a few people working on this project so leaving work checked out isn't really an option either, so what do you do? Suspend your work!

Suspend work will take all your open work items and save them in a suspended state outside of the main project build but still in TFS.

blog2

Once you hit the suspend work button under the My Work section of Team Explorer you can give your work set a comment so you know what it was you were working on when you come back to it, press suspend again and voila your work is now suspended and all open documents have been automatically closed and your workspace completely cleared.

If you go back to solution explorer you will see the work item you were working on is marked as checked in. This is the original version of the file and not your suspended work version, note that this allows other users to come in and edit the same file which will in turn render your suspended work item out of date. It also allows you to check the item out again and make a different set of changes to the same files.

blog3

If you go back to My Work in team explorer, you can view all your suspended work sets, labelled with the comment you gave when it was created, you can go into each one and view the changes within the set and resume the work. This will reopen each of the items you previously had open when the work was suspended complete with breakpoints etc. that were previously present!

If you had already opened the same file again and were editing it, you also have the option to merge your suspended work back in to your current session.

Loading