Install NuGet Packages in Windows Forms Extension

14 Aug 20266 minutes to read

Compatibility

Project type Minimum .NET version
.NET Framework WinForms .NET Framework 4.5 or later
.NET (Core) WinForms .NET Core 3.1 / .NET 5 or later

Overview

NuGet is a package management system for Visual Studio. It makes it easy to add, update, and remove external libraries in your application. Syncfusion publishes all WinForms NuGet packages to nuget.org. The Syncfusion WinForms NuGet packages can be used without installing the Syncfusion Essential Studio setup. You can simply consume the Syncfusion WinForms NuGet packages in a WinForms application to develop with the Syncfusion WinForms components.

From v16.2.0.46 (2018 Volume 2 Service Pack 1) onwards, all Syncfusion WinForms components are available as NuGet packages on nuget.org.

Prerequisites

  • Visual Studio 2017 or later with the NuGet Package Manager workload installed.
  • A WinForms project that targets a Syncfusion-supported .NET versions.
  • An active internet connection to reach the nuget.org feed.
  • If you plan to use the CLI method, install the .NET SDK matching your project target framework.

Installation using Package Manager UI

The NuGet Package Manager UI allows you to search, install, uninstall, and update Syncfusion WinForms NuGet packages in your applications and solutions. You can find and install the Syncfusion WinForms NuGet packages in your Visual Studio WinForms application by following the steps below:

  1. Right-click the WinForms application or solution in Solution Explorer and choose Manage NuGet Packages…

    Manage NuGet Packages add-in

    As an alternative, after opening the WinForms application in Visual Studio, go to the Tools menu, hover NuGet Package Manager, and then select Manage NuGet Packages for Solution…

  2. The Manage NuGet Packages window will open. Navigate to the Browse tab, then search for the Syncfusion WinForms NuGet packages using a term like “Syncfusion.WinForms”, and select the appropriate Syncfusion WinForms NuGet package for your development.

    The nuget.org package source is selected by default in the Package source drop-down. If your Visual Studio does not have nuget.org configured, follow the instructions in the Microsoft documents to set up the nuget.org feed URL.

    WinForms NuGet Packages Search

  3. When you select a package, the right side panel will provide more information about it.

  4. By default, the package is selected with the latest version. Choose the required version, click the Install button, and accept the license terms. The package will be added to your WinForms application.

    WinForms NuGet Packages Install

  5. Your application now has all the required Syncfusion assemblies, and you are ready to start building a high-performance, responsive app with Syncfusion WinForms components. You can also refer to the Syncfusion WinForms help document for development.

Installation using dotnet (.NET) CLI

The dotnet Command Line Interface (CLI) allows you to add, restore, pack, publish, and manage packages without making any changes to your application files. dotnet add package adds a package reference to the application file, then runs dotnet restore to install the package.

Follow the instructions below to use the dotnet CLI to install the Syncfusion WinForms NuGet packages.

  1. Open a command prompt and navigate to the directory that contains your Syncfusion WinForms project file.
  2. Run the following command to install a NuGet package:

     dotnet add package <Package name>

    For example:

     dotnet add package Syncfusion.Grid.Windows

    If you do not provide a version flag, this command upgrades the package to the latest version by default. To specify a version, add the -v parameter: dotnet add package Syncfusion.Grid.Windows -v 19.2.0.57.

  3. Examine the Syncfusion WinForms project file after the command has completed to ensure that the Syncfusion WinForms package was installed. To see the added reference, open the .csproj file.

    WinForms Package Entry

  4. Run dotnet restore to restore all packages listed in the application file.

    Restore is performed automatically by dotnet build and dotnet run in .NET Core 2.0 and later.

Installation using Package Manager Console

The Package Manager Console saves NuGet package installation time: you do not have to search for the Syncfusion WinForms NuGet package you want to install, and you can just type the installation command to install the appropriate Syncfusion WinForms NuGet package. Follow the instructions below to use the Package Manager Console to reference the Syncfusion WinForms component as NuGet packages in your WinForms application.

  1. To show the Package Manager Console, open your WinForms application in Visual Studio and navigate to Tools -> NuGet Package Manager -> Package Manager Console.

    Package Manager Console

  2. The Package Manager Console will appear at the bottom of the screen. Install the Syncfusion WinForms NuGet packages by entering the following NuGet installation commands.

    Install a specified Syncfusion WinForms NuGet package

    The command below installs the Syncfusion WinForms NuGet package in the default WinForms application.

     Install-Package <Package Name>

    For example:

     Install-Package Syncfusion.Grid.Windows

    You can find the list of Syncfusion WinForms NuGet packages published to nuget.org here.

    Install a specified Syncfusion WinForms NuGet package in a specified WinForms application

    The command below installs the Syncfusion WinForms NuGet package in the given WinForms application.

     Install-Package <Package Name> -ProjectName <Project Name>

    For example:

     Install-Package Syncfusion.Grid.Windows -ProjectName SyncfusionWinformsApp
  3. By default, the package is installed with the latest version. Specify the required version with the -Version term to install a particular version, as shown below:

     Install-Package Syncfusion.Grid.Windows -Version 19.2.0.59

    Package Manager Console Output

  4. The NuGet Package Manager Console installs the Syncfusion WinForms NuGet package together with its dependencies. When the installation is complete, the console shows that your Syncfusion WinForms package has been successfully added to the application.

  5. Your application now has all the required Syncfusion assemblies, and you are ready to start building a high-performance, responsive app with Syncfusion WinForms components. You can also refer to the Syncfusion WinForms help document for development.