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

Add NestedTypes to DynamicallyAccessedMember use #817

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaakov-h
Copy link
Contributor

@yaakov-h yaakov-h commented Aug 1, 2021

This prevents nested types - e.g. child objects or arrays of child objects - from being removed by the linker when an application is trimmed.

This only works at the moment in currently unreleased versions of the .NET SDK (e.g. v6.0.100-rc.1.21381.5). It does not work in any publicly released preview up to and including .NET 6 Preview 6.

I observed this when trying to make SteamKit trimmable and when trying to produce trimmed builds of DepotDownloader. Whilst simply "not having child objects" could be considered a valid workaround, we build directly from reverse-engineered protobuf files that we have no real control over.

See dotnet/linker#2185 for more information about use of the attribute.

This prevents nested types - e.g. child objects or arrays of child
objects - from being removed by the linker when an application is
trimmed.

This only works at the moment in current unreleased versions of the
.NET SDK (e.g. .NET 6 rc.1.21381.5). It does not work in any publicly
released preview up to and including .NET 6 Preview 6.

See dotnet/linker#2185 for more information.
@xPaw
Copy link
Contributor

xPaw commented Nov 4, 2023

@mgravell Any chance of this being merged?

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

Successfully merging this pull request may close these issues.

None yet

2 participants