EventSourceException Constructors

Definition

Initializes a new instance of the EventSourceException class.

Overloads

EventSourceException()

Initializes a new instance of the EventSourceException class.

EventSourceException(String)

Initializes a new instance of the EventSourceException class with a specified error message.

EventSourceException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the EventSourceException class with serialized data.

EventSourceException(String, Exception)

Initializes a new instance of the EventSourceException class with a specified error message and a reference to the inner exception that is the cause of this exception.

EventSourceException()

Initializes a new instance of the EventSourceException class.

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

Applies to

EventSourceException(String)

Initializes a new instance of the EventSourceException class with a specified error message.

public:
 EventSourceException(System::String ^ message);
public EventSourceException (string message);
public EventSourceException (string? message);
new System.Diagnostics.Tracing.EventSourceException : string -> System.Diagnostics.Tracing.EventSourceException
Public Sub New (message As String)

Parameters

message
String

The message that describes the error.

Applies to

EventSourceException(SerializationInfo, StreamingContext)

Caution

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

Initializes a new instance of the EventSourceException class with serialized data.

protected:
 EventSourceException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected EventSourceException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[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 EventSourceException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Diagnostics.Tracing.EventSourceException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Diagnostics.Tracing.EventSourceException
[<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.Diagnostics.Tracing.EventSourceException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Diagnostics.Tracing.EventSourceException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

The object that holds the serialized object data.

context
StreamingContext

The contextual information about the source or destination.

Attributes

Applies to

EventSourceException(String, Exception)

Initializes a new instance of the EventSourceException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 EventSourceException(System::String ^ message, Exception ^ innerException);
public EventSourceException (string message, Exception innerException);
public EventSourceException (string? message, Exception? innerException);
new System.Diagnostics.Tracing.EventSourceException : string * Exception -> System.Diagnostics.Tracing.EventSourceException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

The error message that explains the reason for the exception.

innerException
Exception

The exception that is the cause of the current exception, or null if no inner exception is specified.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

Applies to