This documentation is archived and is not being maintained.

VersionControlServer.DownloadFile Method (String, Int32, VersionSpec, String)

Downloads a file from Team Foundation Server and places its contents in a local file.

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

public void DownloadFile(
	string serverPath,
	int deletionId,
	VersionSpec version,
	string localFileName
)

Parameters

serverPath
Type: System.String

The repository path ($/CmdLine/parser.cs) of the file to download.

deletionId
Type: System.Int32

A deletion ID for the item. If the item is not deleted, pass 0. Every deleted item has a non-zero deletion ID that is needed to uniquely identify that item (since one folder may contain multiple deleted items with the same name).

version
Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpec

The version of the file that you want to download

localFileName
Type: System.String

The local path (C:\test\parser.cs) where the file's contents should be stored.

Show: