|
| 1 | +--- |
| 2 | +title: Migrate Telerik Assemblies to NuGet |
| 3 | +page_title: Migrate Telerik Assemblies to NuGet |
| 4 | +description: Learn how to migrate your Telerik UI for WinForms Assemblies to NuGet in your project. |
| 5 | +slug: installation-deployment-and-distribution-migrate-assemblies-nuget |
| 6 | +tags: migrate, package, references, assemblies, project,nuget |
| 7 | +published: True |
| 8 | +position: 10 |
| 9 | +--- |
| 10 | + |
| 11 | +# Migrate Telerik Assemblies to NuGet |
| 12 | + |
| 13 | +The following topic will show you how to migrate Telerik UI for WinForms assemblies to NuGet. But before that let see the benefits of using NuGets instead of assemblies. |
| 14 | + |
| 15 | +## Using NuGet |
| 16 | + |
| 17 | +Using NuGet instead of manually referencing assemblies in Telerik UI for WinForms (or any .NET project) provides several advantages: |
| 18 | + |
| 19 | +### Simplified Dependency Management |
| 20 | + |
| 21 | +NuGet automatically downloads the correct version of Telerik assemblies along with their dependencies (e.g., Telerik.UI.for.WinForms.Common when you install GridView). This means you won’t need to manually reference each required assembly for the controls you use. |
| 22 | + |
| 23 | +### Version Control & Updates |
| 24 | + |
| 25 | +With NuGet, updating Telerik to a new version is as simple as running the Update-Package command or clicking in Visual Studio’s NuGet Manager. Manual assembly updates require replacing .DLL files and updating all projects that reference them, which is a time-consuming operation that can easily lead to version mismatches. |
| 26 | + |
| 27 | +### Framework Targeting |
| 28 | + |
| 29 | +Telerik’s NuGet packages include builds for different target frameworks (e.g., .NET Framework 4.8, .NET 8, .NET 9). NuGet automatically selects the correct assemblies for your project. With manual references, you risk mixing incompatible versions, such as referencing a .NET Framework DLL in a .NET 8 project. |
| 30 | + |
| 31 | +### Consistency Across Projects |
| 32 | + |
| 33 | +n multi-project solutions, NuGet ensures all projects use the same assembly version. With manual references, it’s easy for one project to end up with a different version, potentially causing runtime issues. |
| 34 | + |
| 35 | +## Migrate Manually Referenced Assemblies to NuGet |
| 36 | + |
| 37 | +Next, we’ll walk through how to replace your manually referenced assemblies with NuGet packages, step by step. To demonstrate this, let’s assume we have a project with a **RadGridView** control placed on a form to display our data. |
| 38 | + |
| 39 | +For this project, we also need a scheduling mechanism and a document reader. Here, we can use the **RadScheduler** and **RadRichTextEditor** controls. These three controls from the Telerik UI for WinForms suite require the following assemblies: |
| 40 | + |
| 41 | +* __Telerik.Licensing.Runtime__ |
| 42 | +* __Telerik.WinControls__ |
| 43 | +* __Telerik.WinControls.GridView__ |
| 44 | +* __Telerik.WinControls.RichTextEditor__ |
| 45 | +* __Telerik.WinControls.Scheduler__ |
| 46 | +* __Telerik.WinControls.UI__ |
| 47 | +* __Telerik.Windows.Documents.Core__ |
| 48 | +* __TelerikCommon__ |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +The above assemblies can be replaced with the following NuGets: |
| 53 | + |
| 54 | +* __UI.for.WinForms.GridView__ |
| 55 | +* __UI.for.WinForms.RichTextEditor__ |
| 56 | +* __UI.for.WinForms.Scheduler__ |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +The NuGets will installed the same number assemblies as you have done it manually. All referenced NuGet packages and their version is stored in the **packages.config** file. |
| 61 | + |
| 62 | +The final step will be to migrate to PackageReference. The PackageReference is flexible and lightweight. When used it will remove the **packages.config** file from your project and move the NuGet package information in the **csproj** project file. To migrate the **packages.config** file, you will need to choose the **Migate packages.config to PackageReference...** option from the context menu. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +In our example, __UI.for.WinForms.Scheduler__ have a dependency to the RadGridView NuGet. The __UI.for.WinForms.GridView__ will be collapsed. Now when you expand the Reference node in Visual Studio, you can see the Package References: |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +## See Also |
| 72 | + |
| 73 | +* [Download Product Files]({%slug winforms/installation-deployment-and-distribution/download-product-files%}) |
| 74 | +* [How to Upgrade a Telerik UI for WinForms Project]({%slug how-to-upgrade-a-project%}) |
0 commit comments