<PackageReference Include="System.Diagnostics.EventLog" Version="9.0.0-preview.4.24266.19" />

EventLogException

public class EventLogException : Exception
Represents the base class for all the exceptions that are thrown when an error occurs while reading event log related information.
using System.ComponentModel; using System.Runtime.Serialization; namespace System.Diagnostics.Eventing.Reader { public class EventLogException : Exception { public override string Message { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } } public EventLogException() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } protected EventLogException(int errorCode) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } [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}")] [EditorBrowsable(EditorBrowsableState.Never)] protected EventLogException(SerializationInfo serializationInfo, StreamingContext streamingContext) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } public EventLogException(string message) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } public EventLogException(string message, Exception innerException) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } [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}")] [EditorBrowsable(EditorBrowsableState.Never)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } } }