DiscountASP.NET

Team Foundation Server 2012: Improvements to Working Offline

One of the key highlights of Team Foundation Server 2012 is an improved experience when you’re working offline and you would have to wonder: If it’s mentioned as a key feature, how bad was working offline previously?

If you’ve avoid opening a solution under source control in offline mode, you’re extremely fortunate. But for those that have to experience it with Team Foundation Server 2010, you might hear that it’s easier to call it a day than continue working.

Before going further, it’s important to discuss and understand what’s allowed the improvement: the local workspace. A workspace is a critical feature of Team Foundation Server since it’s what allows the differentiation between the changes that have been made against the data stored on the server and your working copy of files.

Prior to Team Foundation Server 2012, the only type of workspace that was available was a server-side workspace which has drawn plenty of criticism since an active connection to a TFS server was essentially required so that synchronization could occur. While the ability to make changes to files was available, it was an extremely tedious and cumbersome process.

The local workspace was introduced with Team Foundation Server 2012 as the default workspace type and it follows the Edit-Merge-Commit system – any changes that are made are noted and then synchronized with the TFS server at check-in.

There are some advantages and disadvantages between the workspace types so you may want to determine how a workspace will be used against a particular project.

Server workspaces have the following advantages and disadvantages:

Advantages:

Disadvantages:

Local workspaces have the following advantages and disadvantages:

Advantages:

Disadvantages:

The default setting for a workspace is set to local but if you need to alter an existing workspace or create a new workspace, you’ll find the option under the “Add Workspaces” window.

To get an idea of what using a server workspace is like in offline mode, let’s take a quick walkthrough.

Server Workspace

1.    To make sure that there was no connectivity to a server, I used the most effective method of guaranteeing no connection – I unplugged the network cable. After verifying that no network connectivity was available, I opened an available solution in offline mode.

2.    In a sample application that I had available, I updated two files, About.vbhtml and Index.vbhtml and then saved my changes. Here’s what you’ll see every time a file is saved.

3.    I decided to add a new file.

4.    To simulate a restored connection to the server, I just plugged the network cable back in and attempted to go online.

Note: The file that was added is not detected as a change.

5.    The new file will need to be manually added to source control and then checked-in.

Local Workspace

1.    For working offline with a local workspace, I used the same high tech method that I used for the server workspace and opened the solution in offline mode. Here’s what the Solution Explorer window looks like:

2.    I opened and updated the Web.config file and then saved. I was not prompted to overwrite an existing file that was set to read-only and the change was noted immediately:

I continued working and just made a simple change to the Index.vbhtml file.

3.    I reconnected the cable and went online. All of the changes that I had made were recorded as pending changes.

4.    I recreated the disconnected environment, added a new file and then went back online. Unlike the server workspace, the change was detected:

While not everyone may find themselves in a situation where working offline is required, the introduction of the local workspace is a much appreciated and welcomed enhancement.

Exit mobile version