VersionControlServer.GetWorkspace Method (String)

This method starts with a local path and finds a workspace that contains a mapping to that path. Workspace mappings are inherently recursive: if you pass C:\code\CmdLine and no explicit mapping for C:\code\CmdLine is found, Team Foundation Server will search for a mapping to C:\code and then C:\. The search is restricted to mappings for the current user on the current computer.

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

Syntax

'Declaration
Public Function GetWorkspace ( _
    localPath As String _
) As Workspace
'Usage
Dim instance As VersionControlServer 
Dim localPath As String 
Dim returnValue As Workspace 

returnValue = instance.GetWorkspace(localPath)
public Workspace GetWorkspace(
    string localPath
)
public:
Workspace^ GetWorkspace(
    String^ localPath
)
public function GetWorkspace(
    localPath : String
) : Workspace

Parameters

  • localPath
    Type: System.String

    The local path for which you want a workspace created.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.Workspace
Returns a reference to the Workspace object that has mapped the specified local path. If no workspace is found, this method throws an ItemNotMappedException. if you want a null return instead, you can use the TryGetWorkspace method.

Exceptions

Exception Condition
[ItemNotMappedException]

An exception is thrown if the workspace is not found.

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

GetWorkspace Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace