From f023e3d9636d153d526b13bcea87b0a44e54d328 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 Apr 2022 17:40:49 -0700 Subject: [PATCH 1/2] update invoke exceptions for .net 7 --- xml/System.Reflection.Emit/DynamicMethod.xml | 10 ++-- xml/System.Reflection/ConstructorInfo.xml | 8 +-- xml/System.Reflection/MethodBase.xml | 25 ++++----- xml/System.Reflection/PropertyInfo.xml | 20 ++------ xml/System/Activator.xml | 54 ++++++-------------- 5 files changed, 42 insertions(+), 75 deletions(-) diff --git a/xml/System.Reflection.Emit/DynamicMethod.xml b/xml/System.Reflection.Emit/DynamicMethod.xml index c9f415768ef..b8d0f59eaf8 100644 --- a/xml/System.Reflection.Emit/DynamicMethod.xml +++ b/xml/System.Reflection.Emit/DynamicMethod.xml @@ -1842,7 +1842,7 @@ . Executing a dynamic method with a delegate created by the method is more efficient than executing it with the method. @@ -1858,7 +1858,7 @@ This method does not demand permissions directly, but invoking the dynamic method can result in security demands, depending on the method. For example, no demands are made for anonymously hosted dynamic methods that are created with the `restrictedSkipVisibility` parameter set to `false`. On the other hand, if you create a method with `restrictedSkipVisibility` set to `true` so it can access a hidden member of a target assembly, the method will cause a demand for the permissions of the target assembly plus with the flag. > [!NOTE] -> Prior to the .NET Framework 2.0 Service Pack 1, this method required with the flag. +> Prior to .NET Framework 2.0, this method required with the flag. @@ -1874,7 +1874,11 @@ The calling convention is not supported. The number of elements in does not match the number of parameters in the dynamic method. The type of one or more elements of does not match the type of the corresponding parameter of the dynamic method. - The dynamic method is associated with a module, is not anonymously hosted, and was constructed with set to , but the dynamic method accesses members that are not or ( in Visual Basic). + .NET 7 and later versions: The invoked dynamic method throws an exception. + +-or- + +The dynamic method is associated with a module, is not anonymously hosted, and was constructed with set to , but the dynamic method accesses members that are not or ( in Visual Basic). -or- diff --git a/xml/System.Reflection/ConstructorInfo.xml b/xml/System.Reflection/ConstructorInfo.xml index 3f42248a935..ad2ef7df9cc 100644 --- a/xml/System.Reflection/ConstructorInfo.xml +++ b/xml/System.Reflection/ConstructorInfo.xml @@ -402,9 +402,7 @@ This method is a convenience method for the following overloaded version, using default values. This method cannot be overridden. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -487,9 +485,7 @@ Note: In .NET for Win > To create an instance of a value type that has no instance constructors, use the method. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> diff --git a/xml/System.Reflection/MethodBase.xml b/xml/System.Reflection/MethodBase.xml index 78e1b6179c0..a4e9edebff7 100644 --- a/xml/System.Reflection/MethodBase.xml +++ b/xml/System.Reflection/MethodBase.xml @@ -1012,7 +1012,7 @@ The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be or an instance of the class that defines the constructor. An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, should be . - If the method or constructor represented by this instance takes a parameter ( in Visual Basic), no special attribute is required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is . For value-type elements, this value is 0, 0.0, or , depending on the specific element type. + If the method or constructor represented by this instance takes a parameter ( in Visual Basic), no special attribute is required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is . For value-type elements, the default value is 0, 0.0, or , depending on the specific element type. Invokes the method or constructor represented by the current instance, using the specified parameters. An object containing the return value of the invoked method, or in the case of a constructor. @@ -1021,7 +1021,7 @@ ## Remarks This is a convenience method that calls the method overload, passing for `invokeAttr` and `null` for `binder` and `culture`. - If the invoked method throws an exception, the method returns the exception. + If the invoked method throws an exception, the method returns the originating exception. To invoke a static method using its object, pass `null` for `obj`. @@ -1029,11 +1029,9 @@ > If this method overload is used to invoke an instance constructor, the object supplied for `obj` is reinitialized; that is, all instance initializers are executed. The return value is `null`. If a class constructor is invoked, the class is reinitialized; that is, all class initializers are executed. The return value is `null`. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - If a parameter of the current method is a value type, and the corresponding argument in `parameters` is `null`, the runtime passes a zero-initialized instance of the value type. + If a parameter of the reflected method is a value type, and the corresponding argument in `parameters` is `null`, the runtime passes a zero-initialized instance of the value type. @@ -1134,9 +1132,10 @@ Note: In .NET for Win [!NOTE] > If this method overload is used to invoke an instance constructor, the object supplied for `obj` is reinitialized; that is, all instance initializers are executed. The return value is `null`. If a class constructor is invoked, the class is reinitialized; that is, all class initializers are executed. The return value is `null`. @@ -1151,14 +1150,12 @@ Note: In .NET for Win On the other hand, if the method is non-virtual, then reflection will use the implementation given by the type from which the `MethodInfo` was obtained, regardless of the type of the object passed as the target. - Access restrictions are ignored for fully trusted code. That is, private constructors, methods, fields, and properties can be accessed and invoked via reflection whenever the code is fully trusted. - - If the invoked method throws an exception, `TargetInvocationException.GetException` returns the exception. This implementation throws a `NotSupportedException`. + Access restrictions are ignored for fully trusted code. That is, private constructors, methods, fields, and properties can be accessed and invoked via reflection whenever the code is fully trusted. + + If the invoked method throws an exception, the method returns the originating exception. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. diff --git a/xml/System.Reflection/PropertyInfo.xml b/xml/System.Reflection/PropertyInfo.xml index 913a876314b..b56e4875eff 100644 --- a/xml/System.Reflection/PropertyInfo.xml +++ b/xml/System.Reflection/PropertyInfo.xml @@ -1411,9 +1411,7 @@ Console.WriteLine("CurrCult: " + To use the `GetValue` method, first get the class `Type`. From the `Type`, get the `PropertyInfo`. From the `PropertyInfo`, use the `GetValue` method. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -1512,9 +1510,7 @@ Console.WriteLine("CurrCult: " + To use the `GetValue` method, first get the class `Type`. From the `Type`, get the `PropertyInfo`. From the `PropertyInfo`, use the `GetValue` method. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1953,9 +1949,7 @@ Console.WriteLine("CurrCult: " + To use the method, first get a object that represents the class. From the , get the object. From the object, call the method. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -2057,9 +2051,7 @@ Note: In [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index bf312533d97..c7de800b895 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -159,9 +159,7 @@ For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -239,9 +237,7 @@ For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -404,9 +400,7 @@ The method returns `null` for the instances. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -574,9 +568,7 @@ Note: In .NET for Win For more information on how the common language runtime identifies and loads assemblies, see [How the Runtime Locates Assemblies](/dotnet/framework/deployment/how-the-runtime-locates-assemblies). For information on using the application configuration file to define assembly locations, see [Specifying an Assembly's Location](/dotnet/framework/configure-apps/specify-assembly-location). If `assemblyName` is found, it is loaded in the default context. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -685,9 +677,7 @@ Note: In .NET for Win The method returns `null` for the instances. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -798,9 +788,7 @@ Note: In .NET for Win The method returns `null` for the instances with no value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -1001,9 +989,7 @@ Note: In .NET for Win Use to unwrap the return value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1039,7 +1025,11 @@ Note: In .NET for Win -or- The assembly name or code base is invalid. - An error occurred when attempting remote activation in a target specified in . + .NET 7 and later versions: The invoked constructor throws an exception. + +-or- + +An error occurred when attempting remote activation in a target specified in . @@ -1110,9 +1100,7 @@ Note: In .NET for Win The method returns `null` for the instances with no value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1223,9 +1211,7 @@ Note: In .NET for Win The method returns `null` for the instances with no value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1336,9 +1322,7 @@ Note: In .NET for Win The method returns `null` for the instances with no value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1450,9 +1434,7 @@ Note: In .NET for Win The method returns `null` for the instances with no value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> @@ -1657,9 +1639,7 @@ Note: In .NET for Win Use to unwrap the return value. > [!NOTE] -> Starting with the .NET Framework 2.0 Service Pack 1, this method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. +> Starting with .NET Framework 2.0, this method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ]]> From 4f1380a048659b5f71d23bfd37b6dfeb44a230a2 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 11 May 2022 13:05:53 -0700 Subject: [PATCH 2/2] respond to feedback --- xml/System.Reflection.Emit/DynamicMethod.xml | 8 ++------ xml/System/Activator.xml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/xml/System.Reflection.Emit/DynamicMethod.xml b/xml/System.Reflection.Emit/DynamicMethod.xml index b8d0f59eaf8..682bb695528 100644 --- a/xml/System.Reflection.Emit/DynamicMethod.xml +++ b/xml/System.Reflection.Emit/DynamicMethod.xml @@ -1842,7 +1842,7 @@ . + In addition to the listed exceptions, the calling code should be prepared to catch any exceptions thrown by the dynamic method. Executing a dynamic method with a delegate created by the method is more efficient than executing it with the method. @@ -1874,11 +1874,7 @@ The calling convention is not supported. The number of elements in does not match the number of parameters in the dynamic method. The type of one or more elements of does not match the type of the corresponding parameter of the dynamic method. - .NET 7 and later versions: The invoked dynamic method throws an exception. - --or- - -The dynamic method is associated with a module, is not anonymously hosted, and was constructed with set to , but the dynamic method accesses members that are not or ( in Visual Basic). + The dynamic method is associated with a module, is not anonymously hosted, and was constructed with set to , but the dynamic method accesses members that are not or ( in Visual Basic). -or- diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index c7de800b895..ead3acf7954 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -1025,7 +1025,7 @@ Note: In .NET for Win -or- The assembly name or code base is invalid. - .NET 7 and later versions: The invoked constructor throws an exception. + The invoked constructor throws an exception. -or-