EventLogException Constructors

Definition

Initializes a new instance of the EventLogException class.

Overloads

EventLogException()

Initializes a new instance of the EventLogException class.

EventLogException(Int32)

Initializes a new instance of the EventLogException class with the error code for the exception.

EventLogException(String)

Initializes a new instance of the EventLogException class by specifying the error message that describes the current exception.

EventLogException(SerializationInfo, StreamingContext)
Obsolete.

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

EventLogException(String, Exception)

Initializes a new instance of the EventLogException class with an error message and inner exception.

EventLogException()

Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs

Initializes a new instance of the EventLogException class.

C#
public EventLogException();

Applies to

.NET 10 (package-provided) ja muud versioonid
Toode Versioonid
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

EventLogException(Int32)

Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs

Initializes a new instance of the EventLogException class with the error code for the exception.

C#
protected EventLogException(int errorCode);

Parameters

errorCode
Int32

The error code for the error that occurred while reading or configuring event log related information.

Applies to

.NET 10 (package-provided) ja muud versioonid
Toode Versioonid
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

EventLogException(String)

Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs

Initializes a new instance of the EventLogException class by specifying the error message that describes the current exception.

C#
public EventLogException(string message);

Parameters

message
String

The error message that describes the current exception.

Applies to

.NET 10 (package-provided) ja muud versioonid
Toode Versioonid
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

EventLogException(SerializationInfo, StreamingContext)

Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.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 EventLogException class with serialized data.

C#
[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 EventLogException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
C#
protected EventLogException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);

Parameters

serializationInfo
SerializationInfo

The SerializationInfo object that holds the serialized object data about the exception being thrown.

streamingContext
StreamingContext

The StreamingContext object that contains contextual information about the source or destination.

Attributes

Applies to

.NET 10 (package-provided) ja muud versioonid
Toode Versioonid (aegunud)
.NET (8 (package-provided), 9 (package-provided), 10 (package-provided))
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7 (8, 9, 10)

EventLogException(String, Exception)

Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs
Source:
EventLogException.cs

Initializes a new instance of the EventLogException class with an error message and inner exception.

C#
public EventLogException(string message, Exception innerException);

Parameters

message
String

The error message that describes the current exception.

innerException
Exception

The Exception instance that caused the current exception.

Applies to

.NET 10 (package-provided) ja muud versioonid
Toode Versioonid
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10