You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.Reflection.Emit/DynamicMethod.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1820,7 +1820,7 @@
1820
1820
<formattype="text/markdown"><![CDATA[
1821
1821
1822
1822
## Remarks
1823
-
In addition to the listed exceptions, the calling code should be prepared to catch any exceptions thrown by the dynamic method.
1823
+
In addition to the listed exceptions, the calling code should be prepared to catch any exceptions thrown by the dynamic method.
1824
1824
1825
1825
Executing a dynamic method with a delegate created by the <xref:System.Reflection.Emit.DynamicMethod.CreateDelegate%2A> method is more efficient than executing it with the <xref:System.Reflection.Emit.DynamicMethod.Invoke%2A> method.
1826
1826
@@ -1836,7 +1836,7 @@
1836
1836
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 <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess?displayProperty=nameWithType> flag.
1837
1837
1838
1838
> [!NOTE]
1839
-
> Prior to the .NET Framework 2.0 Service Pack 1, this method required <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess> flag.
1839
+
> Prior to .NET Framework 2.0, this method required <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess> flag.
Copy file name to clipboardExpand all lines: xml/System.Reflection/ConstructorInfo.xml
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -402,9 +402,7 @@
402
402
This method is a convenience method for the following overloaded version, using default values. This method cannot be overridden.
403
403
404
404
> [!NOTE]
405
-
> 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 <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).)
406
-
>
407
-
> To use this functionality, your application should target the .NET Framework 3.5 or later.
405
+
> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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.
408
406
409
407
]]></format>
410
408
</remarks>
@@ -487,9 +485,7 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win
487
485
> To create an instance of a value type that has no instance constructors, use the <xref:System.Activator.CreateInstance%2A> method.
488
486
489
487
> [!NOTE]
490
-
> 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 <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).)
491
-
>
492
-
> To use this functionality, your application should target the .NET Framework 3.5 or later.
488
+
> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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.
Copy file name to clipboardExpand all lines: xml/System.Reflection/MethodBase.xml
+11-14Lines changed: 11 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1012,7 +1012,7 @@
1012
1012
<paramname="obj">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 <seelangword="null" /> or an instance of the class that defines the constructor.</param>
1013
1013
<paramname="parameters">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, <paramrefname="parameters" /> should be <seelangword="null" />.
1014
1014
1015
-
If the method or constructor represented by this instance takes a <seelangword="ref" /> parameter (<seelangword="ByRef" /> 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 <seelangword="null" />. For value-type elements, this value is 0, 0.0, or <seelangword="false" />, depending on the specific element type.</param>
1015
+
If the method or constructor represented by this instance takes a <seelangword="ref" /> parameter (<seelangword="ByRef" /> 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 <seelangword="null" />. For value-type elements, the default value is 0, 0.0, or <seelangword="false" />, depending on the specific element type.</param>
1016
1016
<summary>Invokes the method or constructor represented by the current instance, using the specified parameters.</summary>
1017
1017
<returns>An object containing the return value of the invoked method, or <seelangword="null" /> in the case of a constructor.</returns>
1018
1018
<remarks>
@@ -1021,19 +1021,17 @@
1021
1021
## Remarks
1022
1022
This is a convenience method that calls the <xref:System.Reflection.MethodBase.Invoke%28System.Object%2CSystem.Reflection.BindingFlags%2CSystem.Reflection.Binder%2CSystem.Object%5B%5D%2CSystem.Globalization.CultureInfo%29> method overload, passing <xref:System.Reflection.BindingFlags.Default> for `invokeAttr` and `null` for `binder` and `culture`.
1023
1023
1024
-
If the invoked method throws an exception, the <xref:System.Exception.GetBaseException%2A?displayProperty=nameWithType> method returns the exception.
1024
+
If the invoked method throws an exception, the <xref:System.Exception.GetBaseException%2A?displayProperty=nameWithType> method returns the originating exception.
1025
1025
1026
1026
To invoke a static method using its <xref:System.Reflection.MethodInfo> object, pass `null` for `obj`.
1027
1027
1028
1028
> [!NOTE]
1029
1029
> 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`.
1030
1030
1031
1031
> [!NOTE]
1032
-
> 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 <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).)
1033
-
>
1034
-
> To use this functionality, your application should target the .NET Framework 3.5 or later.
1032
+
> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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.
1035
1033
1036
-
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.
1034
+
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.
1037
1035
1038
1036
1039
1037
@@ -1134,9 +1132,10 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win
1134
1132
<formattype="text/markdown"><![CDATA[
1135
1133
1136
1134
## Remarks
1137
-
Dynamically invokes the method reflected by this instance on `obj`, and passes along the specified parameters. If the method is static, the `obj` parameter is ignored. For non-static methods, `obj` should be an instance of a class that inherits or declares the method and must be the same type as this class. If the method has no parameters, the value of `parameters` should be `null`. Otherwise, the number, type, and order of elements in `parameters` should be identical to the number, type, and order of parameters for the method reflected by this instance.
1135
+
1136
+
This method dynamically invokes the method reflected by this instance on `obj`, and passes along the specified parameters. If the method is static, the `obj` parameter is ignored. For non-static methods, `obj` should be an instance of a class that inherits or declares the method and must be the same type as this class. If the method has no parameters, the value of `parameters` should be `null`. Otherwise, the number, type, and order of elements in `parameters` should be identical to the number, type, and order of parameters for the method reflected by this instance.
1138
1137
1139
-
You may not omit optional parameters in calls to `Invoke`. To invoke a method omitting optional parameters, you should call `Type.InvokeMember` instead.
1138
+
You may not omit optional parameters in calls to `Invoke`. To invoke a method and omit optional parameters, call `Type.InvokeMember` instead.
1140
1139
1141
1140
> [!NOTE]
1142
1141
> 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 <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win
1151
1150
1152
1151
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.
1153
1152
1154
-
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.
1155
-
1156
-
If the invoked method throws an exception, `TargetInvocationException.GetException` returns the exception. This implementation throws a `NotSupportedException`.
1153
+
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.
1154
+
1155
+
If the invoked method throws an exception, the <xref:System.Exception.GetBaseException%2A?displayProperty=nameWithType> method returns the originating exception.
1157
1156
1158
1157
> [!NOTE]
1159
-
> 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 <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).)
1160
-
>
1161
-
> To use this functionality, your application should target the .NET Framework 3.5 or later.
1158
+
> Starting with .NET Framework 2.0, this method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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.
0 commit comments