-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Trimmed compilation fails with annotations #539
Labels
Comments
Warnings for reflection can be enabled using the following switch <IsTrimmable>true</IsTrimmable> |
samuel-lucas6
added a commit
to samuel-lucas6/Kryptor
that referenced
this issue
Dec 3, 2023
Added some new lines to shorten and clarify the dotnet publish command. Unfortunately, PublishTrimmed can't be set to true like in .NET 6 due to issues with the CommandLineUtils library: natemcmaster/CommandLineUtils#539. If that's fixed, it will be changed as it significantly reduces the executable size. EnableCompressionInSingleFile also reduces the executable size but worsens performance. PublishReadyToRunComposite is worth investigating for better start up time on Linux but increases executable size. Finally, PublishAot could also be investigated but requires trimming and may cause problems.
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project. |
This issue remains relevant. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compilation with trimming fails due to reflection. Trimming is often used with single file executables:
Compilation yields the following warning:
Execution fails with the following exception:
Enabling reflection for public methods yield the following exception:
Enabling reflection for both, public methods and constructors resolves the issue.
This requires the following annotation:
Please add these annotations to all reflection methods consuming
Type
s and generic type arguments.I am glad to provide more information on the subject, please also refer to https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
The text was updated successfully, but these errors were encountered: