-
Notifications
You must be signed in to change notification settings - Fork 395
[deploy net7.0] Self-contained exe with trimming unused code throws TargetInvocationException #1974
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
Comments
sorry i forgot the exception details: |
Trimming is currently not possible -at least not with default trim settings- with the System.CommandLine NamingConventionBinder package, as per comment from System.CommandLine author and maintainer here: #1750 (comment). You might try configuring the trimming in such a way that it accounts for the types and members accessed through reflection by the NamingConventionBinder (https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-7-0#root-descriptors), |
Thanks for your explanation! |
STR:
HostingPlayground.exe --name 'Joe'
When the "Trim unused code" checkbox is unchecked, the exception is no longer thrown.
The text was updated successfully, but these errors were encountered: