NuGet.VisualStudio 17.11.0-preview.2

Prefix Reserved
This is a prerelease version of NuGet.VisualStudio.
dotnet add package NuGet.VisualStudio --version 17.11.0-preview.2                
NuGet\Install-Package NuGet.VisualStudio -Version 17.11.0-preview.2                
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" Version="17.11.0-preview.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NuGet.VisualStudio --version 17.11.0-preview.2                
#r "nuget: NuGet.VisualStudio, 17.11.0-preview.2"                
#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.
// Install NuGet.VisualStudio as a Cake Addin
#addin nuget:?package=NuGet.VisualStudio&version=17.11.0-preview.2&prerelease

// Install NuGet.VisualStudio as a Cake Tool
#tool nuget:?package=NuGet.VisualStudio&version=17.11.0-preview.2&prerelease                

NuGet.VisualStudio

This package provides APIs for invoking NuGet services in Visual Studio. It contains NuGet’s older services that are available via the Managed Extensibility Framework (MEF).

Usage

After installing the package, you can use its services to interact with NuGet in Visual Studio. This can be used to install and uninstall packages, and to obtain information about installed packages.

MEF Services

From NuGet 6.0, all of these APIs are available in the package NuGet.VisualStudio. In NuGet 5.11 and earlier, the APIs in the namespace NuGet.VisualStudio are available in the package NuGet.VisualStudio, and APIs in the namespace NuGet.SolutionRestoreManager are available in the package NuGet.SolutionRestoreManager.Interop.

Example

Get installed packages

To use a service, import it through the MEF Import attribute, or through the IComponentModel service.

// Using the Import attribute
[Import(typeof(IVsPackageInstaller2))]
public IVsPackageInstaller2 packageInstaller;
packageInstaller.InstallLatestPackage(source: null, currentProject,
    "Newtonsoft.Json", includePrerelease: false, ignoreDependencies: false);

// Using the IComponentModel service
var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
IVsPackageUninstaller uninstallerServices =
    componentModel.GetService<IVsPackageUninstaller>();

var uninstallerServices = installerServices.UninstallPackage(currentProject, "Newtonsoft.json", removeDependencies: true);

Additional documentation

More information about the NuGet.VisualStudio library can be found on the NuGet API docs.

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

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

Package Downloads
SuntekSolutions.SkyScraper.Core

.NET SQLServer Data Access, Object Relational Mapper and Caching Library

TwitterTracker

Package Description

TwitterTracker.Filter

Package Description

BlazorAnkitSharma

A reusable component for Blazor (with many features)

AmqpServer

This is a simple Amqp wrapper to reduce boilerplate code.

GitHub repositories (22)

Showing the top 5 popular GitHub repositories that depend on NuGet.VisualStudio:

Repository Stars
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
unoplatform/uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
microsoft/dotnet-apiport
This repo contains .NET Portability Analyzer (VSIX and Console) libraries and tools
dotnet/project-system
The .NET Project System for Visual Studio
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.
Version Downloads Last updated
17.11.0-preview.2 79 6/5/2024
17.10.1 510 6/27/2024
17.10.0 770 5/21/2024
17.9.1 1,839 2/13/2024
17.8.1 168 2/13/2024
17.8.0 3,188 11/17/2023
17.7.1 232 2/14/2024
17.7.0 29,188 8/9/2023
17.6.2 231 2/13/2024
17.6.1 2,247 6/13/2023
17.6.0 1,262 5/17/2023
17.6.0-preview.3 101 5/17/2023
17.5.1 330 6/13/2023
17.5.0 3,100 2/22/2023
17.4.3 106 2/13/2024
17.4.2 202 6/13/2023
17.4.0 8,712 11/9/2022
17.3.4 118 2/13/2024
17.3.3 150 6/14/2023
17.3.1 1,480 10/11/2022
17.2.4 150 6/14/2023
17.2.2 3,401 10/11/2022
17.1.0 64,944 2/16/2022
6.0.6 130 2/13/2024
6.0.5 214 6/13/2023
6.0.3-rc.1 123 10/11/2022
6.0.2 937 6/14/2022
5.11.6 209 2/13/2024
5.11.5 688 6/15/2023
5.11.3 3,964 10/11/2022
5.10.0 6,013 6/15/2021
5.9.3 434 10/11/2022
5.8.1 1,011 1/16/2021
5.7.3-rtm.5 149 10/11/2022
5.7.2 467 6/14/2022
5.6.0 8,308 5/20/2020
5.5.1 2,202 4/3/2020
5.4.0 7,764 12/3/2019
5.3.1 1,415 10/25/2019
5.2.1 150 6/14/2022
5.1.0 10,406 5/21/2019
5.0.2 732 5/14/2019
4.9.6 190 10/11/2022
4.8.2 418 3/12/2019
4.7.3 369 3/15/2019
4.6.4 5,795 3/15/2019
4.5.3 487 3/15/2019
4.4.3 1,008 3/15/2019
4.3.1 853 3/12/2019
4.2.0 6,648 7/14/2017
4.1.0 1,748 7/14/2017
4.0.0 90,547 3/7/2017
3.5.0 33,046 1/18/2017
3.3.0 148,050 1/14/2016
2.8.6 21,701 7/21/2015
2.7.2 2,786 11/11/2013
2.6.0 1,929 6/26/2013
2.5.0 1,916 4/25/2013
2.2.0 2,393 12/12/2012
2.1.0 5,733 10/4/2012