+This warning can also be caused by passing a type to a field, paramter, argument, or return value that is annotated with <xref:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute>. <xref:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute> implies reflection access over all of the listed <xref:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes>. This means that when a type is passed to a parameter, field, generic parameter, or return value annotated with <xref:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods> .NET tooling assumes that all public methods are accessed via reflection. If a type that contains a method with an annotated parameter or return value is passed to a location annotated with <xref:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods>, then IL2111 will be raised.
0 commit comments