diff --git a/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj b/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj index ec0746abe6f490..1e1f3f7cda7500 100644 --- a/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj +++ b/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj @@ -3,7 +3,6 @@ $(NetCoreAppCurrent) true - false 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 eaf613dbd9c32d..44b0472875eb81 100644 --- a/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs +++ b/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxy.cs @@ -6,22 +6,23 @@ namespace System.Reflection { /// - /// DispatchProxy provides a mechanism for the instantiation of proxy objects and handling of - /// their method dispatch. + /// Provides a mechanism for instantiating proxy objects and handling their method dispatch. /// public abstract class DispatchProxy { + /// + /// Initializes a new instance of the class. + /// protected DispatchProxy() { } /// - /// Whenever any method on the generated proxy type is called, this method - /// will be invoked to dispatch control. + /// Whenever any method on the generated proxy type is called, this method is invoked to dispatch control. /// - /// The method the caller invoked - /// The arguments the caller passed to the method - /// The object to return to the caller, or null for void methods + /// The method the caller invoked. + /// The arguments the caller passed to the method. + /// The object to return to the caller, or for void methods. protected abstract object? Invoke(MethodInfo? targetMethod, object?[]? args); /// @@ -31,8 +32,7 @@ protected DispatchProxy() /// The interface the proxy should implement. /// The base class to use for the proxy class. /// An object instance that implements . - /// is a class, - /// or is sealed or does not have a parameterless constructor + /// is not an interface type, or is sealed or abstract 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. @@ -50,10 +50,12 @@ protected DispatchProxy() /// The interface the proxy should implement. /// The base class to use for the proxy class. /// An object instance that implements . - /// or is null - /// is a class, - /// or is sealed or abstract or does not inherited from the - /// type or have a parameterless constructor + /// or is . + /// + /// is not an interface type. + /// -or- + /// is sealed or abstract, or does not inherit from the type or does not have a parameterless constructor. + /// [RequiresDynamicCode("Creating a proxy instance requires generating code at runtime")] public static object Create([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type proxyType) {