Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateWorkspace Method (String, String, String)

VersionControlServer.CreateWorkspace Method (String, String, String)

Creates a new workspace. The calling identity must have CreateWorkspace global permission. The computer attribute is the current machine. The new workspace is empty: it has no folder mappings, which must be added later with the workspace Update method.

Namespace:  Microsoft.TeamFoundation.VersionControl.Client
Assembly:  Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)

public Workspace CreateWorkspace(
	string name,
	string owner,
	string comment


Type: System.String

The name of this workspace. The name must be unique for the current user, and must adhere to the following rules:

The string must not be null or empty.

The string must not end in white space.

The string length must be less than or equal to the constant RepositoryConstants.MaxWorkspaceNameSize (64 characters).

The name must not contain any characters that could not be part of a filename.

Type: System.String

The owner of this workspace. You must use the string constant RepositoryConstants.AuthenticatedUser or "." to default to the current user.

Type: System.String

A descriptive comment that you want to use for the workspace.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.Workspace
Returns a reference to a Workspace object that represents the new workspace. If the workspace cannot be created, an exception occurs.

The calling identity must have the GlobalPermissionCreateWorkspace global permission. The workspace has no working folders and the computer attribute uses the current computer. An exception occurs if the workspace cannot be created.

Community Additions

© 2015 Microsoft