BackgroundServiceExceptionBehavior Enum

Definition

Specifies a behavior that the IHost will honor if an unhandled exception occurs in one of its BackgroundService instances.

C#
public enum BackgroundServiceExceptionBehavior
Inheritance
BackgroundServiceExceptionBehavior

Fields

Name Value Description
StopHost 0

Stops the IHost instance.

Ignore 1

Ignore exceptions thrown in BackgroundService.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)