Decide Between Using a Local or a Server Workspace

When you create or edit a workspace, you can specify whether its location is Local or Server. In most cases, local is best because it provides several advantages. Most notably, you can perform core version control operations even when you're not connected to your Team Foundation Server.

What do you want to do?

There are a lot of things to love about a local workspace:

Work offline easily. You can quickly begin editing a file when your network connection is unavailable or unreliable. From Solution Explorer you can add, edit, delete, rename, undo, and compare items in your workspace even when you're not connected to your Team Foundation Server.

Easily restore files that you have deleted locally. To restore locally deleted files, just get your files.

Visual Studio automatically detects changes. When you add or delete files outside of Visual Studio, the program automatically detects these changes.

Note Note

Pending changes of team members who use local workspaces are not visible to other team members in Source Control Explorer.

Even though a local workspace is a better option for most people, there are some special cases when you might find a server workspace useful:

  • Performance degrades as the number of items in a local workspace increases.

  • A workspace that contains a very large number of files. Visual Studio keeps only one copy of each file in a server workspace, which reduces the disk space required to store them.

  • You can use Visual Studio 2010 and earlier versions to work with the workspace.

  • The Enable get latest on check-out option is available.

Some challenges you face if you use a server workspace:

Work offline with difficulty and with poor performance. When you are offline, you cannot work with your local files because they are read-only until you check them out. You can check out files only from Solution Explorer, and only after you switch to offline mode (as explained below). While you're offline, you can't perform any other operations, such as add, delete, rename, or undo.

Tip Tip

You can improve responsiveness by enabling asynchronous checkout. For more information, see Manage team project collection workspace settings for your team.

When you use a server workspace and cannot connect to your Team Foundation Server, Source Control Explorer is disabled. However, if you have local copies of your files in your server workspace, you can still edit them from Solution Explorer. After the server becomes available again, you can check the changes into version control.

Tip Tip

If working offline is important to you, then you should consider using a local workspace instead of a server workspace See Local Workspaces earlier in this topic.

Required Permissions

You must be one of the Contributors for your team project. See Team Foundation Server Default Groups, Permissions, and Roles.

To work with version-controlled files when the server is offline

  1. From your local working folder, open the solution that you want to work on.

    If the server is offline, the Go Offline dialog box appears.

  2. Choose OK, and then edit your solution files.

  3. On the File menu, choose Save.

  4. In the Save of Read-Only File dialog box, choose Overwrite to remove the write-protection from the file.

To commit your offline changes to the server when it is available

  1. In Solution Explorer, open the shortcut menu for the solution or file, and then choose Go Online.

    The Go Online dialog box appears and shows the changes that you made offline.

  2. Under Name, select the check box for each change that you want to check in, and then choose Go Online.

    The changes that you made offline are added to Team Foundation version control as pending changes.

  3. In Solution Explorer, open the shortcut menu for the files that you edited offline, and then choose Check In to commit the changes to the server.

You can specify which type of workspace Visual Studio creates for your team members by default: Local or Server. You can also enable asynchronous checkout for your team’s server workspaces.

Required Permissions

You must be one of the Administrators for your team project collection. See Team Foundation Server Default Groups, Permissions, and Roles.

How to: set the default workspace location

  1. On the menu bar, choose Team, Team Project Collection Settings, Source Control.

    The Source Control Settings dialog box appears.

  2. On the Workspace Settings tab, choose either the Local or Server option button.

  3. You can reduce the time the system takes to check out files to server workspaces by selecting Enable asynchronous checkout in server workspaces. If you select this option:

    • The PendChange permission is no longer enforced.

    • Checkout locks are disabled