We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

VersionControlServer.ServerItemExists Method (String, ItemType)

Returns true if the specified file or folder is located in the Team Foundation Server database in a non-deleted state.

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

public bool ServerItemExists(
	string path,
	ItemType itemType
)

Parameters

path
Type: System.String

The file or folder that you want to get. This may be a Team Foundation Server path ($/CmdLine/parse.cs) or a local path (C:\Code\CmdLine\parse.cs), in the latter case, the local path is mapped to a server path by way of a workspace. Wildcards should not be passed here: they will cause an exception to occur.

itemType
Type: Microsoft.TeamFoundation.VersionControl.Client.ItemType

The ItemType.Folder that you want to get for a folder, the ItemType.File that you want to getfor a file, or the ItemType.Any method which returns true if either is found.

Return Value

Type: System.Boolean
Returns true if the item is found in Team Foundation Server in a non-deleted state.

Show: