What is the DynamicallyAccessedMembers attribute?
DynamicallyAccessedMembers tells the .NET trimmer and AOT compiler which members of a Type you reach by reflection, so they are kept instead of trimmed away. It turns a silent runtime MissingMethodException into a build-time IL2070 warning. Here is what the attribute does, how the data-flow analysis behind it works, and how to annotate parameters, fields, and generic type parameters correctly.