NuGet.VisualStudio.Contracts
17.7.1
Prefix Reserved
See the version list below for details.
dotnet add package NuGet.VisualStudio.Contracts --version 17.7.1
NuGet\Install-Package NuGet.VisualStudio.Contracts -Version 17.7.1
<PackageReference Include="NuGet.VisualStudio.Contracts" Version="17.7.1" />
paket add NuGet.VisualStudio.Contracts --version 17.7.1
#r "nuget: NuGet.VisualStudio.Contracts, 17.7.1"
// Install NuGet.VisualStudio.Contracts as a Cake Addin #addin nuget:?package=NuGet.VisualStudio.Contracts&version=17.7.1 // Install NuGet.VisualStudio.Contracts as a Cake Tool #tool nuget:?package=NuGet.VisualStudio.Contracts&version=17.7.1
NuGet.VisualStudio.Contracts
The package NuGet.VisualStudio.Contracts contains RPC contracts for NuGet’s Visual Studio Service Broker extensibility APIs. These APIs are designed to be usable with async code and are available in this package using Visual Studio’s IServiceBroker
.
Usage
Install the NuGet.VisualStudio.Contracts package into your project, as well as Microsoft.VisualStudio.SDK.
Use the IAsyncServiceProvider to get Visual Studio's service broker, and use that to get NuGet's service. Note that AsyncPackage extends IVsAsyncServiceProvider2, so your class that implements AsyncPackage can be used as the IAsyncServiceProvider. Also see the docs on IBrokeredServiceContainer and IServiceBroker
// Your AsyncPackage implements IAsyncServiceProvider
IAsyncServiceProvider asyncServiceProvider = this;
var brokeredServiceContainer = await asyncServiceProvider.GetServiceAsync<SVsBrokeredServiceContainer, IBrokeredServiceContainer>();
IServiceBroker serviceBroker = brokeredServiceContainer.GetFullAccessServiceBroker();
INuGetProjectService nugetProjectService = await serviceBroker.GetProxyAsync<INuGetProjectService>(NuGetServices.NuGetProjectServiceV1);
Example
Get installed packages of a project.
InstalledPackagesResult installedPackagesResult;
using (nugetProjectService as IDisposable)
{
installedPackagesResult = await nugetProjectService.GetInstalledPackagesAsync(projectGuid, cancellationToken);
}
Additional documentation
More information about the NuGet.VisualStudio.Contracts library can be found on the NuGet API docs.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.ServiceHub.Framework (>= 4.1.112)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on NuGet.VisualStudio.Contracts:
Repository | Stars |
---|---|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK from source
|
|
X-Sharp/XSharpPublic
Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
|
Version | Downloads | Last updated | |
---|---|---|---|
17.12.1 | 226 | 11/12/2024 | |
17.12.0 | 103 | 11/12/2024 | |
17.11.1 | 146 | 10/1/2024 | |
17.11.0 | 174 | 8/13/2024 | |
17.11.0-preview.2 | 85 | 6/5/2024 | |
17.10.2 | 125 | 8/12/2024 | |
17.10.1 | 199 | 6/27/2024 | |
17.10.0 | 849 | 5/21/2024 | |
17.9.1 | 375 | 2/13/2024 | |
17.8.1 | 208 | 2/13/2024 | |
17.8.0 | 356 | 11/17/2023 | |
17.7.1 | 161 | 2/14/2024 | |
17.7.0 | 490 | 8/9/2023 | |
17.6.2 | 378 | 2/13/2024 | |
17.6.1 | 284 | 6/13/2023 | |
17.6.0 | 480 | 5/17/2023 | |
17.6.0-preview.3 | 90 | 5/17/2023 | |
17.5.1 | 283 | 6/13/2023 | |
17.5.0 | 511 | 2/22/2023 | |
17.4.3 | 117 | 2/13/2024 | |
17.4.2 | 168 | 6/13/2023 | |
17.4.0 | 784 | 11/9/2022 | |
17.3.4 | 121 | 2/13/2024 | |
17.3.3 | 182 | 6/14/2023 | |
17.3.1 | 686 | 10/11/2022 | |
17.2.4 | 161 | 6/14/2023 | |
17.2.2 | 412 | 10/11/2022 | |
17.1.0 | 860 | 2/16/2022 | |
6.0.6 | 122 | 2/13/2024 | |
6.0.5 | 232 | 6/13/2023 | |
6.0.3-rc.1 | 122 | 10/11/2022 | |
6.0.2 | 470 | 6/14/2022 | |
5.11.6 | 486 | 2/13/2024 | |
5.11.5 | 191 | 6/15/2023 | |
5.11.3 | 1,328 | 10/11/2022 | |
5.10.0 | 5,473 | 6/15/2021 | |
5.9.3 | 435 | 10/11/2022 | |
5.8.1 | 197 | 1/16/2021 | |
5.7.3-rtm.5 | 143 | 10/11/2022 | |
5.7.2 | 482 | 6/14/2022 |