From 0ff4280a2fbbcd6bab3af679ddf8a22ebf311d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Mon, 1 Aug 2022 11:09:53 +0900 Subject: [PATCH] Link issue to the RDC attribute on DispatchProxy --- .../src/System/Reflection/DispatchProxy.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs b/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs index 9a971cb6bc86c9..4382a382676083 100644 --- a/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs +++ b/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs @@ -33,6 +33,9 @@ protected DispatchProxy() /// An object instance that implements . /// is a class, /// or is sealed or does not have a parameterless constructor + // + // https://github.com/dotnet/runtime/issues/73136 - we can remove the RequiresDynamicCode annotation. + // This has been done AOT-safely with .NET Native in the past. [RequiresDynamicCode("Creating a proxy instance requires generating code at runtime")] public static T Create<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TProxy>() where TProxy : DispatchProxy