Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third-party (DevExpress) DLLs not being trimmed #772

Closed
EatonZ opened this issue Oct 1, 2019 · 11 comments
Closed

Third-party (DevExpress) DLLs not being trimmed #772

EatonZ opened this issue Oct 1, 2019 · 11 comments
Labels

Comments

@EatonZ
Copy link

EatonZ commented Oct 1, 2019

When using the PublishTrimmed setting on a .NET Core 3.0 WinForms project, combined with the DevExpress.WindowsDesktop.Win NuGet package, the entirety of that package gets bundled with the app, despite the PublishTrimmed setting. That is around 150 MB, most of which probably is not required at all.

DevExpress is aware of the problem and has determined that any fixes will need to go into .NET Core/linker. I hope you will consider improving the trimming feature in the near future, as huge WinForms apps are not particularly enticing right now.

DevExpress ticket for reference

@marek-safar
Copy link
Contributor

Could you please attach or link the project which reproduces this behaviour?

@EatonZ
Copy link
Author

EatonZ commented Oct 3, 2019

Hi @marek-safar, please see the latest comment from DevExpress here (very bottom).

@zezba9000
Copy link

zezba9000 commented Oct 16, 2019

Are you using:
<PublishReadyToRun>true</PublishReadyToRun>
That can make the result larger.

@EatonZ
Copy link
Author

EatonZ commented Oct 16, 2019

@zezba9000 Yup - I know about that setting, and that it does indeed increase sizes further. It's not quite related to this issue since this is about DLLs not being trimmed / unnecessary ones being included.

@marek-safar Let me know if you need anything else that may help.

@SimonCropp
Copy link

a repro using newtonsoft

new console app:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishTrimmed>true</PublishTrimmed>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
  </ItemGroup>
</Project>

no code in the program.cs

dotnet publish

Newtonsoft.Json.dll is still in the publish dir

@EatonZ
Copy link
Author

EatonZ commented Apr 3, 2020

Hi! With .NET 5 development well underway, what can be expected on this front?

@SimonCropp
Copy link

@marek-safar should this still have the "needs more info" label?

@marek-safar
Copy link
Contributor

DevExpress libraries will most likely have to be validated for .NET5 to see if they are using any linker incompatible APIs

@SimonCropp
Copy link

@marek-safar shouldnt a consumer be allowed to opt in to trim any dlls they want?

@marek-safar
Copy link
Contributor

They will most likely be able to do that in .net 5 as well

@vitek-karas
Copy link
Member

This has been improved in .NET 6+. See the available options here: https://docs.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants