This adds DynamicallyAccessedMembers annotations to most required areas, and fixes the vast majority of warnings caused by their absence. This should improve compatibility with more aggressive trimming modes in .NET 8.
In my case specifically, I'm seeing constructors trimmed out despite the annotations being present on the underlying Marshal helpers from SharpGenTools. With these annotations in place, trimming works successfully.
Please let me know if any changes need to be made; I'd like to see this merged in sooner rather than later. Thank you!
This adds
DynamicallyAccessedMembers
annotations to most required areas, and fixes the vast majority of warnings caused by their absence. This should improve compatibility with more aggressive trimming modes in .NET 8.In my case specifically, I'm seeing constructors trimmed out despite the annotations being present on the underlying Marshal helpers from SharpGenTools. With these annotations in place, trimming works successfully.
Please let me know if any changes need to be made; I'd like to see this merged in sooner rather than later. Thank you!