ProtocolViolationException Constructors

Definition

Initializes a new instance of the ProtocolViolationException class.

Overloads

ProtocolViolationException()

Initializes a new instance of the ProtocolViolationException class.

ProtocolViolationException(String)

Initializes a new instance of the ProtocolViolationException class with the specified message.

ProtocolViolationException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the ProtocolViolationException class from the specified SerializationInfo and StreamingContext instances.

ProtocolViolationException()

Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs

Initializes a new instance of the ProtocolViolationException class.

public:
 ProtocolViolationException();
public ProtocolViolationException ();
Public Sub New ()

Remarks

The Message property is initialized to a system-supplied message that describes the error. The InnerException property is initialized to null.

Applies to

ProtocolViolationException(String)

Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs

Initializes a new instance of the ProtocolViolationException class with the specified message.

public:
 ProtocolViolationException(System::String ^ message);
public ProtocolViolationException (string message);
public ProtocolViolationException (string? message);
new System.Net.ProtocolViolationException : string -> System.Net.ProtocolViolationException
Public Sub New (message As String)

Parameters

message
String

The error message string.

Remarks

This constructor initializes a new instance of the ProtocolViolationException class with the Message property set to the value of the message parameter. If message is a null reference, the Message property is initialized to a system-supplied message. The InnerException property is initialized to null.

Applies to

ProtocolViolationException(SerializationInfo, StreamingContext)

Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs
Source:
ProtocolViolationException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the ProtocolViolationException class from the specified SerializationInfo and StreamingContext instances.

protected:
 ProtocolViolationException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected ProtocolViolationException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected ProtocolViolationException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.ProtocolViolationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.ProtocolViolationException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.ProtocolViolationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.ProtocolViolationException
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Parameters

serializationInfo
SerializationInfo

A SerializationInfo that contains the information that is required to deserialize the ProtocolViolationException.

streamingContext
StreamingContext

A StreamingContext that contains the source of the serialized stream that is associated with the new ProtocolViolationException.

Attributes

Remarks

This constructor implements the ISerializable interface for the ProtocolViolationException class.

See also

Applies to