Exercise 3: Local Workspaces
In this exercise, you will learn about local workspaces and how they improve the offline development experience.
Open the FabrikamFiber.CallCenter solution from the Dev branch in Source Control Explorer.
Figure 20
Source Control Explorer window
- Prior to Team Foundation Server 11, source control operations were performed exclusively on the server, so working in a disconnected, offline scenario was oftentimes tedious. To improve the development experience for smaller teams and projects, Local Workspaces have been introduced that provide a more client-centric workflow, a style of version control often described as Modify-Merge-Commit.
As an aside, server-based workspaces, which are better suited for larger projects, can still be used. Load the Manage Workspaces window by typing ‘workspaces’ into the Quick Launch search box in the top-right corner of Visual Studio and wait a second or two for the results to load.
Figure 21
Location of Quick Launch bar
The Quick Launch search box is new to Visual Studio 11 and it can save you time that you would have otherwise spent clicking through menus to reach various tools and commands. Use the Ctrl+Q key combination to avoid the mouse altogether.
Select the Workspaces… command link.
Figure 22
Selecting the Workspaces link
In the Manage Workspaces window, select the Add… button to start creating a new workspace.
Figure 23
Location of Add button to create new workspace
In the Add Workspace window, select the Advanced button to see all available options.
Figure 24
Location of Advanced button to view advanced workspace properties
Locate the Location workspace property. By default, new workspaces will use local workspaces, but you can choose to create a server-based workspace if desired.
Figure 25
Choosing between Local and Server workspace
- Close the workspace windows by pressing the Escape key twice.
In Solution Explorer, expand both the FabrikamFiber.Web project and then the Content folder.
Figure 26
Navigating to the Content folder of FabrikamFiber.Web project
Single-click the fullcalendar.css file to view its contents. Note that the file is loaded in the CSS Source Editor as expected, but the tab for it is shown on the right-hand side. This new tab type is called a preview tab – as you use the arrow keys to navigate between files or single-click on them, the preview tab will be replaced with the most recent selection. Preview tabs help address the problem where you can easily overwhelm your Visual Studio tab real estate with files that you only need temporarily.
There is a button within the preview tab itself that allows you promote it to a regular tab. See the arrow in the screenshot above.
Make an arbitrary change to the fullcalendar.css file by changing one of the style properties. Visual Studio will indicate that the file has been checked out, but keep in mind that this has only been done in the local workspace. Other team members will not see that you are working on this file.
Figure 28
Check mark next to file shows that you have made changes to it locally
- Two of the major benefits of the local workspaces are that the disconnected, offline work scenario is greatly improved, and it is much easier to use external tools to work with files in source control. To demonstrate both of these benefits in action, let’s proceed by stopping the Team Foundation Server site in IIS. This will simulate a scenario where you are working offline, such as writing code from the beach. In a real-world scenario, you would never write code from the beach - you would be enjoying your vacation.
Load Internet Information Services (IIS) Manager from Start | All Programs | Administrative Tools.
Figure 29
Shortcut location for IIS Manager
In IIS Manager, expand the VSALM server node and the Sites node to find and select the Team Foundation Server site.
Figure 30
Stopping Team Foundation Server
- In the Actions pane, select the Stop button (see screenshot above for button location).
Return to Visual Studio, load the Source Control Explorer window, and select the refresh button. Note that the window is now in a disconnected state.
Figure 31
Source Control Explorer in disconnected state
Even though we are now in a disconnected state with Team Foundation Server, we can continue to do work. Right-click on the Content folder in Solution Explorer and select the Open Folder in Windows Explorer option.
Figure 32
Location of option to open folder in Explorer
Add a new file into the Content folder by right-clicking in a blank area of the view and selecting New | Text Document from the context menu.
We will use this file in a demonstration a little later – the contents are not important.
Figure 33
Creating a new text document
In the Explorer window, right-click on the Site.css file and select Open With | Notepad from the context menu.
Figure 34
Opening a checked-in file with Notepad
In Notepad, change the ‘body’ style color to ‘red’.
Figure 35
Editing a file in Notepad and saving changes
In Notepad, save and close the Site.css file and return to Solution Explorer. Note that Visual Studio detected the change to the file and that the file was not read-only as it would have been in the case of a server-based workspace.
Figure 36
Visual Studio shows that the file has changed
|
|