Remove unused .dll from WPF .net 5 Project

1 Answer 811 Views
Installer and Visual Studio Extensions
Chris
Top achievements
Rank 1
Chris asked on 26 Sep 2021, 02:22 AM | edited on 26 Sep 2021, 02:23 AM

When using Telerik with .net 5 the output includes all the Telerik .dlls even the ones that are not used.  The output from a project containing an empty window is over 100mb. 

With .net framework there was a way to configure the project and only include the referenced assemblies.  Is there a way to do the same for a .net 5 project?

Andrew
Top achievements
Rank 2
commented on 30 Nov 2021, 10:26 PM

I agree it's crazy that a basic app using one or two controls has over 100Mb of .dll's in the folder. There needs to be a way of removing the unused files (like you can with .NET Framework).

 

Vesko
Telerik team
commented on 06 Dec 2021, 08:29 AM

Ni Andrew,

Can you please, provide more details about your project like:

  1. What version of Visual Studio do you use to build your projects? If you use other tools to build, please, let us know which they are.
  2. What Telerik references do you have in your project? Are they PackageReferences or regular ones. It will be really convenient if you provide your *.csproj/*.vbproj files to take a look or put here snippets with your references.
Andrew
Top achievements
Rank 2
commented on 06 Dec 2021, 10:29 AM

I'm creating .NET 6 WPF app with VS 2022. With .NET 4.8 there was the ability to select which Telerik components are included with your project so you could manage the size of the app folder. With .NET 6 (and earlier versions I guess) it includes all the WPF controls. I have a 49kb application .dll but 132MB of your .dll's. That's pretty wasteful of space as I bet 99% of the .dll's are not really required.
Vesko
Telerik team
commented on 08 Dec 2021, 12:56 PM

Hi Andrew,

I suppose that your projects have package references to some of our full NuGet packages like Telerik.UI.for.Wpf.60.Xaml. These packages contain all the assemblies which is the reason why you end up with all the controls in the bin folder. Until we provide an easy way to select the required assemblies in your projects you can manage your individual dependencies using our NuGet feed. There you will find the exact packages that you need like Telerik.Windows.Controls.Chart.for.Wpf.

Another approach is App Trimming which is an option to remove unused assemblies as part of publishing your application. Here is an article that may be useful regarding application trimming.

1 Answer, 1 is accepted

Sort by
0
Vesko
Telerik team
answered on 29 Sep 2021, 12:47 PM

Hello Chris,

The assemblies that are copied to your output folder generally depend on your build environment. In order to address your concern, please, provide the following details:

  • What version of Visual Studio do you use to build your projects? If you use other tools to build, please, let us know which they are.
  • What Telerik references do you have in your project? Are they PackageReferences or regular ones. It will be really convenient if you provide your *.csproj/*.vbproj files to take a look or put here snippets with your references.

Currently, we do not provide project configuration functionality for .NET 5 similar to the one for .NET Framework. However, we plan to provide it in the near future. So at this time your best approach to manage your project dependencies is our NuGet feed. Alternatively, you can manage your references manually using your installation folders as hint paths.

Regards,
Vesko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Installer and Visual Studio Extensions
Asked by
Chris
Top achievements
Rank 1
Answers by
Vesko
Telerik team
Share this question
or