Partager via


WorkspacesExtensionMethods.AddExistingFileAsync Method

Definition

Adds an existing file on disk to the project.

public static System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot> AddExistingFileAsync (this Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot projectSnapshot, Uri fileToAdd, System.Threading.CancellationToken cancellationToken);
static member AddExistingFileAsync : Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot * Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot>
<Extension()>
Public Function AddExistingFileAsync (projectSnapshot As IProjectSnapshot, fileToAdd As Uri, cancellationToken As CancellationToken) As Task(Of IProjectSnapshot)

Parameters

projectSnapshot
IProjectSnapshot

Project snapshot to add file to.

fileToAdd
Uri

an URI representing a local path on disk.

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

A new IProjectSnapshot instance with the file added.

Applies to