VOOZH about

URL: https://www.nuget.org/packages/NuGet.VisualStudio.Contracts/

⇱ NuGet Gallery | NuGet.VisualStudio.Contracts 17.14.0




👁 Image
NuGet.VisualStudio.Contracts 17.14.0

Prefix Reserved
dotnet add package NuGet.VisualStudio.Contracts --version 17.14.0
 
 
NuGet\Install-Package NuGet.VisualStudio.Contracts -Version 17.14.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NuGet.VisualStudio.Contracts" Version="17.14.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NuGet.VisualStudio.Contracts" Version="17.14.0" />
 
Directory.Packages.props
<PackageReference Include="NuGet.VisualStudio.Contracts" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NuGet.VisualStudio.Contracts --version 17.14.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NuGet.VisualStudio.Contracts, 17.14.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NuGet.VisualStudio.Contracts@17.14.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NuGet.VisualStudio.Contracts&version=17.14.0
 
Install as a Cake Addin
#tool nuget:?package=NuGet.VisualStudio.Contracts&version=17.14.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on NuGet.VisualStudio.Contracts:

Package Downloads
Microsoft.CodeAnalysis.ExternalAccess.Apex

A supporting package for Apex (internal integration testing library): https://devdiv.visualstudio.com/DevDiv/_git/VS?path=/src/Omni/Apex More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/dotnet/commit/ddf39a1b4690fbe23aea79c78da67004a5c31094.

Microsoft.CodeAnalysis.ExternalAccess.FSharp

A supporting package for F#: https://github.com/Microsoft/visualfsharp More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/dotnet/commit/ddf39a1b4690fbe23aea79c78da67004a5c31094.

Microsoft.CodeAnalysis.ExternalAccess.EditorConfigGenerator

A supporting package for editor config generation. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/dotnet/commit/ddf39a1b4690fbe23aea79c78da67004a5c31094.

Microsoft.VisualStudio.LanguageServices.LiveShare

A private package for the liveshare team to grant access to LSP implementations. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/dotnet/commit/ddf39a1b4690fbe23aea79c78da67004a5c31094.

Microsoft.VisualStudio.LanguageServices.ExternalAccess.Copilot

A supporting package for Copilot features: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_git/VisualStudio.Conversations More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/dotnet/commit/ddf39a1b4690fbe23aea79c78da67004a5c31094.

GitHub repositories (5)

Showing the top 5 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.
mrlacey/Rapid-XAML-Toolkit
A collection of tools to accelerate XAML development within Visual Studio. These include XAML analysis, XAML generations, plus templates and helpers.
FortuneN/FineCodeCoverage
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
X-Sharp/XSharpPublic
Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
Version Downloads Last Updated
17.14.0 1,343 5/13/2025
17.13.2 407 2/28/2025
17.13.1 310 2/12/2025
17.12.4 329 5/7/2025
17.12.1 1,097 11/12/2024
17.12.0 293 11/12/2024
17.11.1 390 10/1/2024
17.11.0 347 8/13/2024
17.11.0-preview.2 154 6/5/2024
17.10.2 306 8/12/2024
17.10.1 380 6/27/2024
17.10.0 2,137 5/21/2024
17.9.1 1,869 2/13/2024
17.8.1 384 2/13/2024
17.7.1 329 2/14/2024
17.6.2 1,687 2/13/2024
17.4.3 288 2/13/2024
17.3.4 289 2/13/2024
6.0.6 306 2/13/2024
5.11.6 2,321 2/13/2024
Loading failed