Skip to content
This repository has been archived by the owner on Feb 23, 2025. It is now read-only.

Annotate .Net 6 Assembly As Trimmable #390

Closed
mwasplund opened this issue Jul 11, 2023 · 1 comment · Fixed by #391
Closed

Annotate .Net 6 Assembly As Trimmable #390

mwasplund opened this issue Jul 11, 2023 · 1 comment · Fixed by #391
Assignees

Comments

@mwasplund
Copy link
Contributor

As of .Net 6 assemblies can be annotated with the IsTrimmable property. This will enable warnings for publish as trimmed issues. Once all of these issues are addressed or annotated as RequireUnreferencedCode the downstream consumer can publish their final executable with all unused code trimmed out.

https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming

@enclave-alistair
Copy link

Just to note that this issue, when building for net8, meant I got the error:

Reflection-based serialization has been disabled for this application

when using the NoValidationIdentityTokenValidator. This is because the trimmed publish defaults for System.Text.Json in net8 have changed to fail on attempts to use reflection serialisation.

I had to manually copy the patched code from #391; eagerly awaiting the release of the changes in that PR.

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

Successfully merging a pull request may close this issue.

3 participants