-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TypeLoadException on System.Windows.Forms.Control.SetAcceptDrops in DotNet 8 Preview 4 when Trimming #9155
Comments
Related: #4649 |
I'll move to .NET 9 since we're not going to close on #4649 in .NET 8 |
But this is critical! I mean it has worked in DotNet 7 just fine, so it appears to be a regression and a very important one to address. Right now it means no trimming support at all for WinForms, since all but the most trivial apps do make use of User Controls. Is there a chance to address the User Control aspect of it still in time for DotNet 8? Or at least, perhaps you could advise if it would be possible to still trim the app assembly-wise, by excluding certain assemblies, like the app itself, WinForms assemblies presumably and perhaps some others? And why would it break in DotNet 8 when it was working fine - at least without this complete show-stopper error in DotNet 7? |
With .NET 8 you can set TrimMode to partial, which will probably fix it: |
Thanks for the suggestion @cyanfish As a temporary workaround, I instead added: Still, proper trimming support for it is a must! |
We do not officially support trimming in WinForms as there are a variety of scenarios that do not work and are unlikely to get addressed in the near term. Most notably we have dependencies on |
.NET version
8.0.100-preview.4.23260.5
Did it work in .NET Framework?
No (Not applicable)
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, it works fine in DotNet 7.
Issue description
During runtime, after I publish my app as a self-contained, trimmed (does not matter the mode) executable, I get the following error even before any form is shown:
Steps to reproduce
The text was updated successfully, but these errors were encountered: