InCycle Software's Application Modernization and DevOps Blog

Seamlessly work off-site with Visual Studio 2012 Local Workspaces

Written by Sahas Subramanian | Sep 9, 2012 2:49:34 PM

 

Visual Studio has been one of the finest and widely used tools for software development. Microsoft remained focused to offer best features for all disciplines across ALM. Over the years, we have seen a lot new features got added into Visual Studio that help to improve productivity, performance and team collaboration.

 

Visual Studio 2012 is no exception…plenty of new features and enhancements. Especially, if you are a developer, VS 2012 carries significant productivity improvement features such as

 

  • My work – smart way to multitask that guarantees no data loss. Efficiently suspend your work, store code changes & retrieve them automatically, when you resume work
  • Code review – integrated code review process flow within Team explorer
  • Improvements in comparison tool – probably, you will stop using 3rd party compare tools anymore.. VS 2012 comparison tool very powerful
  • Local Workspace – better solution to work off-site when you are not connected to the version control tool
  • New Test Explorer and many more..

 

One of my favorite enhancements is the “Local workspace” feature

 

In earlier versions of Visual Studio, workspace requires version control server connectivity always. Meaning, if you happen to work offline for any reason.. there hasn’t been a straight solution for a developer to work offline and reconcile changes, it requires careful manual work..

For example, if you lose network connectivity and open a .sln file, VS 2010 would give you an option to open the solution in “offline” mode. You may continue to make changes offline. While saving, you would choose to “Overwrite” which will turn off read-only mode of those files and save the change.

 

Once you go online again, you need to manually choose “Go online” which will check out the files, resolve conflicts (if need be) and commit the changes to the version control.

 

If you look at the workflow, it’s not very seamless and required a bit manual work. Similarly, you cannot perform any other operation like add, delete, rename etc…

 

So, VS 2012 comes with a better solution for these scenarios. Now, there are two kinds of workspaces

 

  1. Local Workspace – need not be connected to the source control server always, easy to work offline, VS detects changes automatically and checks out files
  2. Server Workspace – need source control server connectivity always, you need to offline mode when not connected but compatible with previous versions of VS

 

Here is a detailed write up might be useful to choose between these workspaces

 

When creating a workspace, there is a new dropdown that allows us to choose the type of workspace

 

Imagine, I’ve created a ‘Local Workspace’ and have gone offline. But I should be able to launch the solution and check out files for edit.

 

 

Below you could see that I’m not connected to Source Control Server but still can check-out files

 

 

 

 

 

Now, I should be able to compare my changes with the workspace version & undo pending changes exactly the same way how you do when connected to source control server

Finally, once you go online, all the changes should appear in the pending changes list for you to review and check-in.