VersionControlServer.CreateWorkspace Method (String)

Creates a new workspace. The calling identity must have CreateWorkspace global permission. The comment is empty, the computer attribute is the current machine, and the workspace owner is the current user. 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)

Syntax

'Declaration
Public Function CreateWorkspace ( _
    name As String _
) As Workspace
'Usage
Dim instance As VersionControlServer 
Dim name As String 
Dim returnValue As Workspace 

returnValue = instance.CreateWorkspace(name)
public Workspace CreateWorkspace(
    string name
)
public:
Workspace^ CreateWorkspace(
    String^ name
)
public function CreateWorkspace(
    name : String
) : Workspace

Parameters

  • name
    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.

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.

Remarks

The calling identity must have the GlobalPermissionCreateWorkspace global permission. The comment for the workspace is empty, the computer attribute uses the current computer, and the workspace has no working folder mappings. An exception is occurs if the workspace cannot be created.

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

CreateWorkspace Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace