Share via


UpdateExtensions.AddPackageReference Method

Definition

Adds a NuGet package reference to projects.

public static Microsoft.VisualStudio.ProjectSystem.Query.IAsyncUpdatable<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot> AddPackageReference (this Microsoft.VisualStudio.ProjectSystem.Query.IAsyncUpdatable<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot> projects, string packageIdentity, string version);
static member AddPackageReference : Microsoft.VisualStudio.ProjectSystem.Query.IAsyncUpdatable<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot> * string * string -> Microsoft.VisualStudio.ProjectSystem.Query.IAsyncUpdatable<Microsoft.VisualStudio.ProjectSystem.Query.IProjectSnapshot>
<Extension()>
Public Function AddPackageReference (projects As IAsyncUpdatable(Of IProjectSnapshot), packageIdentity As String, version As String) As IAsyncUpdatable(Of IProjectSnapshot)

Parameters

projects
IAsyncUpdatable<IProjectSnapshot>

A set of projects where this change should apply to.

packageIdentity
String

The identity of the package reference to be added.

version
String

The version of the package reference to be added.

Returns

A set of projects updated.

Applies to