Open Genmutant opened 3 months ago
Thank you for pointing this out! The UnsafeAccessorAttribute
is indeed a great feature, and I would love to eliminate the reflection code. However, I plan to stick with .NET 6 until the end of the year, and I prefer not to complicate the code with conditional compilation directives (ifdefs).
Is there another way to address your issue? Are there possibilities for configuring the trimming, such as ignoring a specific class during the trimming process?
Best regards, Kevin
Yes, it's possible to manually force it to keep the complete classes when trimming. I haven't checked if AOT would still work though.
Thanks for your fast answer and work!
Would it be possible to generate private method accessors using UnsafeAccessorAttribute when targetting at least dotnet8? That would make it safe to use with NativeAOT and Trimming, as the accessed attributes are marked as used and not removed.