SecurityException.Method Property

Definition

Gets or sets the information about the method associated with the exception.

C#
public System.Reflection.MethodInfo? Method { get; set; }
C#
public System.Reflection.MethodInfo Method { get; set; }
C#
[System.Runtime.InteropServices.ComVisible(false)]
public System.Reflection.MethodInfo Method { get; set; }

Property Value

A MethodInfo object describing the method.

Attributes

Remarks

Važno

Using an instance of this object with untrusted data is a security risk. Use this object only with trusted data. For more information, see Validate All Inputs.

This property contains one of the following:

  • Information about the method that the failed assembly was executing when the security check that triggered the exception occurred.

  • Information about the method that placed either a PermitOnly or Deny security action on the call stack, in the case of a failure due to a PermitOnly or Deny.

  • null, in the case of a failure that is impossible to attribute to a specific method.

The MethodInfo object provides the method name, class name, and assembly name information that uniquely identifies the method.

Applies to

Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1