MethodException Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
MethodException() |
Initializes a new instance of MethodException with the message set to typeof(MethodException).FullName. |
MethodException(String) |
Initializes a new instance of MethodException setting the message. |
MethodException(SerializationInfo, StreamingContext) |
Obsolete.
Initializes a new instance of MethodException with serialization parameters. |
MethodException(String, Exception) |
Initializes a new instance of MethodException setting the message and innerException. |
MethodException()
Initializes a new instance of MethodException with the message set to typeof(MethodException).FullName.
public:
MethodException();
public:
MethodException();
MethodException();
public MethodException ();
Public Sub New ()
Applies to
MethodException(String)
Initializes a new instance of MethodException setting the message.
public:
MethodException(System::String ^ message);
public:
MethodException(Platform::String ^ message);
MethodException(std::wstring const & message);
public MethodException (string message);
new System.Management.Automation.MethodException : string -> System.Management.Automation.MethodException
Public Sub New (message As String)
Parameters
- message
- String
The exception's message.
Applies to
MethodException(SerializationInfo, StreamingContext)
Caution
Legacy serialization support is deprecated since .NET 8
Initializes a new instance of MethodException with serialization parameters.
protected:
MethodException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected MethodException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")]
protected MethodException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Management.Automation.MethodException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.MethodException
[<System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")>]
new System.Management.Automation.MethodException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.MethodException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Parameters
- info
- SerializationInfo
Serialization information.
- context
- StreamingContext
Streaming context.
- Attributes
Applies to
MethodException(String, Exception)
Initializes a new instance of MethodException setting the message and innerException.
public:
MethodException(System::String ^ message, Exception ^ innerException);
public MethodException (string message, Exception innerException);
new System.Management.Automation.MethodException : string * Exception -> System.Management.Automation.MethodException
Public Sub New (message As String, innerException As Exception)
Parameters
- message
- String
The exception's message.
- innerException
- Exception
The exception's inner exception.