Install Syncfusion WinUI NuGet packages

8 Jun 20226 minutes to read

Overview

NuGet is a Package management system for Visual Studio. It makes it easy to add, update and remove external libraries in our application. Syncfusion publishing all WinUI NuGet packages in nuget.org. The Syncfusion WinUI NuGet packages can be used without installing the Syncfusion installation. You can simply exploit the Syncfusion WinUI NuGet packages in your WinUI application to develop with the Syncfusion WinUI controls.

NOTE

Syncfusion WinUI NuGet packages are available from v18.3.0.35 (Essential Studio 2020 Volume 3).

Installation using Package Manager UI

The NuGet Package Manager UI allows you to search, install, uninstall, and update Syncfusion WinUI NuGet packages in your projects and solutions. You can find and install the Syncfusion WinUI NuGet packages in your Visual Studio WinUI application and this process is easy with the steps below:

  1. Right-click on the WinUI project or solution in the Solution Explorer, and choose Manage NuGet Packages…

    Manage NuGet Packages add-in

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

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

    NOTE

    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.

    WinUI NuGet Packages Search

    NOTE

    Please check the Include prerelease checkbox, if you want to search and install the Syncfusion WinUI beta NuGet packages.

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

  4. By default, the package selected with latest version. You can choose the required version and click the Install button and accept the license terms. The package will be added to your WinUI application.

    WinUI NuGet Packages Install

  5. At this point, your application has all the required Syncfusion assemblies, and you will be ready to start building high-performance, responsive app with Syncfusion WinUI controls. Also, you can refer to the WinUI help document for development.

Installation using Package Manager Console

The Package Manager Console saves NuGet packages installation time since you don’t have to search for the Syncfusion WinUI NuGet package which you want to install, and you can just type the installation command to install the appropriate Syncfusion WinUI NuGet package. Follow the instructions below to use the Package Manager Console to reference the Syncfusion WinUI component as NuGet packages in your WinUI application.

  1. To show the Package Manager Console, open your WinUI application in Visual Studio and navigate to Tools in the Visual Studio menu and after hovering NuGet Package Manager, select Package Manager Console.

    Package Manager Console

  2. The Package Manager Console will be shown at the bottom of the screen. You can install the Syncfusion WinUI NuGet packages by enter the following NuGet installation commands.

    Install specified Syncfusion WinUI NuGet package.

    The below command will install the Syncfusion WinUI NuGet package in the default WinUI project of the application.

     Install-Package <Package Name>
    

    For example: Install-Package Syncfusion.Grid.WinUI

    NOTE

    You can find the list of Syncfusion WinUI NuGet packages which are published in nuget.org from here

    Install specified Syncfusion WinUI NuGet package in specified WinUI project

    The below command will install the Syncfusion WinUI NuGet package in the given WinUI project of the application.

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

    For example: Install-Package Syncfusion.Grid.WinUI -ProjectName SyncfusionWinUIApp

    NOTE

    You must use the -prerelease term with the NuGet installation command (Install-Package Syncfusion.Grid.WinUI -prerelease), if you want to install the Syncfusion WinUI beta NuGet packages.

  3. By default, the package will be installed with latest version. You can give the required version with the -Version term like below to install the Syncfusion WinUI NuGet packages in the appropriate version.

     Install-Package Syncfusion.Grid.WinUI -Version 19.2.0.44
    

    Package Manager Console Output

  4. The NuGet package manager will install the Syncfusion WinUI NuGet package as well as the dependencies it has. When the installation is complete, the console will show that your Syncfusion WinUI package has been successfully added to the project.

  5. At this point, your application has all the required Syncfusion assemblies, and you will be ready to start building high-performance, responsive app with Syncfusion WinUI controls. Also, you can refer to the WinUI 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 project files. Dotnet add package adds a package reference to the project file, then runs dotnet restore to install the package.

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

  1. Open a command prompt and navigate to the directory where your WinUI project file is located.
  2. To install a NuGet package, run the following command.

      dotnet add package <Package name>
    

    For Example:
    dotnet add package Syncfusion.Grid.WinUI

    NOTE

    You must use the –prerelease term with the NuGet installation command (dotnet add package Syncfusion.Grid.WinUI –prerelease), if you want to install the Syncfusion WinUI beta NuGet packages.

    NOTE

    If you don’t provide a version flag, this command will be upgrading to the latest version by default. To specify a version, add the -v parameter: dotnet add package Syncfusion.Grid.WinUI -v 19.2.0.44.

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

    WinUI Package Entry

  4. Then run dotnet restore command to restores all the packages listed in the project file.

    NOTE

    Restoring is done automatically with dotnet build and dotnet run in.NET Core 2.0 and later.

  5. At this point, your application has all the required Syncfusion assemblies, and you will be ready to start building high-performance, responsive app with Syncfusion WinUI controls. Also, you can refer to the WinUI help document for development.