Microsoft.Extensions.Hosting Specifies a behavior that the will honor if an unhandled exception occurs in one of its instances. Stops the instance. If a throws an exception, the instance stops, and the process continues. Ignore exceptions thrown in . If a throws an exception, the will log the error, but otherwise ignore it. The is not restarted. Provides option flags for . Gets or sets a value that indicates if host lifetime status messages should be suppressed, such as on startup. if host lifetime status messages should be suppressed. The default is . Provides convenience methods for creating instances of with pre-configured defaults. Initializes a new instance of the class with pre-configured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load app from 'appsettings.json' and 'appsettings.[].json' load app from User Secrets when is 'Development' using the entry assembly load app from environment variables configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' The initialized . Initializes a new instance of the class with pre-configured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load host from supplied command line args load app from 'appsettings.json' and 'appsettings.[].json' load app from User Secrets when is 'Development' using the entry assembly load app from environment variables load app from supplied command line args configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' The command line args. The initialized . Initializes a new instance of the class with pre-configured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load app from 'appsettings.json' and 'appsettings.[].json' load app from User Secrets when is 'Development' using the entry assembly load app from environment variables configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' The initialized . Initializes a new instance of the class with pre-configured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load host from supplied command line args load app from 'appsettings.json' and 'appsettings.[].json' load app from User Secrets when is 'Development' using the entry assembly load app from environment variables load app from supplied command line args configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' The command line args. The initialized . Controls the initial configuration and other settings for constructing the . Initializes a new instance of the class with no pre-configured defaults. Controls the initial configuration and other settings for constructing the . The initialized . Represents a hosted applications and services builder that helps manage configuration, logging, lifetime, and more. Initializes a new instance of the class with preconfigured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load host from supplied command line args load app from 'appsettings.json' and 'appsettings.[].json' load app from '[].settings.json' and '[].settings.[].json' when is not empty load app from User Secrets when is 'Development' using the entry assembly load app from environment variables load app from supplied command line args configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' Initializes a new instance of the class with preconfigured defaults. The following defaults are applied to the returned : set the to the result of load host from "DOTNET_" prefixed environment variables load host from supplied command line args load app from 'appsettings.json' and 'appsettings.[].json' load app from '[].settings.json' and '[].settings.[].json' when is not empty load app from User Secrets when is 'Development' using the entry assembly load app from environment variables load app from supplied command line args configure the to log to the console, debug, and event source output enables scope validation on the dependency injection container when is 'Development' The command line args. Initializes a new instance of the . Settings controlling initial configuration and whether default settings should be used. Gets the set of key/value configuration properties. This can be mutated by adding more configuration sources, which will update its current view. Builds the host. This method can only be called once. An initialized . Settings for constructing an . Initializes an instance of the class. Gets or sets a value that indicates whether the instance is configured with pre-configured defaults. if the instance is configured with pre-configured defaults. This has a similar effect to calling . The following defaults are applied to the : * set the to the result of * load from "DOTNET_" prefixed environment variables * load from 'appsettings.json' and 'appsettings.[].json' * load from User Secrets when is 'Development' using the entry assembly * load from environment variables * load from supplied command line args * configure the to log to the console, debug, and event source output * enables scope validation on the dependency injection container when is 'Development' Gets or sets the command-line arguments to add to the . Gets or sets the initial configuration sources to be added to the . These sources can influence the through the use of keys. Disposing the built disposes the . Gets or sets the environment name. Gets or sets the application name. Gets or sets the content root path. A program initialization utility. Initializes a new instance of . Gets a central location for sharing state between components during the host building process. Set up the configuration for the builder itself. This will be used to initialize the for use later in the build process. This can be called multiple times and the results will be additive. The delegate for configuring the that will be used to construct the for the host. The same instance of the for chaining. Sets up the configuration for the remainder of the build process and application. This can be called multiple times and the results will be additive. The results will be available at for subsequent operations, as well as in . The delegate for configuring the that will be used to construct the for the host. The same instance of the for chaining. Adds services to the container. This can be called multiple times and the results will be additive. The delegate for configuring the that will be used to construct the for the host. The same instance of the for chaining. Overrides the factory used to create the service provider. The type of the builder to create. A factory used for creating service providers. The same instance of the for chaining. Overrides the factory used to create the service provider. A factory used for creating service providers. The type of the builder to create. The same instance of the for chaining. Enables configuring the instantiated dependency container. This can be called multiple times and the results will be additive. The type of the builder to create. The delegate for configuring the that will be used to construct the for the host. The same instance of the for chaining. Run the given actions to initialize the host. This can only be called once. An initialized . Adds basic services to the host such as application lifetime, host environment, and logging. Provides extension methods for the from the hosting package. Specifies the environment to be used by the host. To avoid the environment being overwritten by a default value, ensure this is called after defaults are configured. The to configure. The environment to host the application in. The . Specifies the content root directory to be used by the host. To avoid the content root directory being overwritten by a default value, ensure this is called after defaults are configured. The to configure. Path to root directory of the application. The . Specifies the to be the default one. The to configure. The delegate that configures the . The . Specifies the to be the default one. The to configure. The delegate that configures the . The . Adds a delegate for configuring the provided . This can be called multiple times. The to configure. The delegate that configures the . The same instance of the for chaining. Adds a delegate for configuring the provided . This can be called multiple times. The to configure. The delegate that configures the . The same instance of the for chaining. Adds a delegate for configuring the of the . The to configure. The delegate for configuring the . The same instance of the for chaining. Adds a delegate for configuring the of the . The to configure. The delegate for configuring the . The same instance of the for chaining. Sets up the configuration for the remainder of the build process and application. This can be called multiple times and the results will be additive. The results will be available at for subsequent operations, as well as in . The to configure. The delegate for configuring the that will be used to construct the for the host. The same instance of the for chaining. Adds services to the container. This can be called multiple times and the results will be additive. The to configure. The delegate for configuring the . The same instance of the for chaining. Enables configuring the instantiated dependency container. This can be called multiple times and the results will be additive. The type of builder. The to configure. The delegate for configuring the . The same instance of the for chaining. Configures an existing instance with pre-configured defaults. This will overwrite previously configured values and is intended to be called before additional configuration calls. The following defaults are applied to the : * set the to the result of * load host from "DOTNET_" prefixed environment variables * load host from supplied command line args * load app from 'appsettings.json' and 'appsettings.[].json' * load app from '[].settings.json' and '[].settings.[].json' when is not empty * load app from User Secrets when is 'Development' using the entry assembly * load app from environment variables * load app from supplied command line args * configure the to log to the console, debug, and event source output * enables scope validation on the dependency injection container when is 'Development' The existing builder to configure. The command line args. The same instance of the for chaining. Listens for Ctrl+C or SIGTERM and calls to start the shutdown process. This will unblock extensions like RunAsync and WaitForShutdownAsync. The to configure. The same instance of the for chaining. Listens for Ctrl+C or SIGTERM and calls to start the shutdown process. This will unblock extensions like RunAsync and WaitForShutdownAsync. The to configure. The delegate for configuring the . The same instance of the for chaining. Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down. The to configure. A that can be used to cancel the console. A that only completes when the token is triggered or shutdown is triggered. Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down. The to configure. The delegate for configuring the . A that can be used to cancel the console. A that only completes when the token is triggered or shutdown is triggered. Adds a delegate for configuring the provided . This can be called multiple times. The to configure. The delegate that configures the . The same instance of the for chaining. Adds a delegate for configuring the provided . This can be called multiple times. The to configure. The delegate that configures the . The same instance of the for chaining. Options for . Gets or sets the default timeout for . This timeout also encompasses all host services implementing and . Gets or sets the default timeout for . This timeout also encompasses all host services implementing and . Gets or sets a value that indicates if the will start registered instances of concurrently or sequentially. if the will start registered instances of concurrently; if the will start registered instances sequentially. The default is . Gets or sets a value that indicates if the will stop registered instances of concurrently or sequentially. if the will stop registered instances of concurrently; if the will stop registered instances sequentially. The default is . Gets or sets the behavior the will follow when any of its instances throw an unhandled exception. Defaults to . Allows consumers to perform cleanup during a graceful shutdown. Initializes an instance using the specified logger. The logger to initialize this instance with. Gets a cancellation token. Triggered when the application host has fully started and is about to wait for a graceful shutdown. Gets a cancellation token. Triggered when the application host is performing a graceful shutdown. Request might still be in flight. Shutdown will block until this event completes. Gets a cancellation token. Triggered when the application host is performing a graceful shutdown. All requests should be complete at this point. Shutdown will block until this event completes. Signals the ApplicationStopping event and blocks until it completes. Signals the ApplicationStarted event and blocks until it completes. Signals the ApplicationStopped event and blocks until it completes. Listens for Ctrl+C or SIGTERM and initiates shutdown. Initializes a instance using the specified console lifetime options, host environment, host application lifetime, and host options. An object used to retrieve instances. Information about the hosting environment an application is running in. An object that allows consumers to be notified of application lifetime events. An object used to retrieve internal host options instances. or or or is . Initializes a instance using the specified console lifetime options, host environment, host options, and logger factory. An object used to retrieve instances. Information about the hosting environment an application is running in. An object that allows consumers to be notified of application lifetime events. An object used to retrieve instances. An object to configure the logging system and create instances of from the registered . or or or or is . Registers the application start, application stop and shutdown handlers for this application. The cancellation token to monitor for cancellation requests. A that represents the asynchronous registration operation. This method does nothing. A cancellation token instance. A that represents a completed task. Unregisters the shutdown handlers and disposes the application start and application stop registrations. Order: IHostLifetime.WaitForStartAsync Services.GetService{IStartupValidator}().Validate() IHostedLifecycleService.StartingAsync IHostedService.Start IHostedLifecycleService.StartedAsync IHostApplicationLifetime.ApplicationStarted Order: IHostedLifecycleService.StoppingAsync IHostApplicationLifetime.ApplicationStopping IHostedService.Stop IHostedLifecycleService.StoppedAsync IHostApplicationLifetime.ApplicationStopped IHostLifetime.StopAsync This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. Minimalistic lifetime that does nothing. Suppresses reporting of a specific rule violation, allowing multiple suppressions on a single code artifact. is different than in that it doesn't have a . So it is always preserved in the compiled assembly. Initializes a new instance of the class, specifying the category of the tool and the identifier for an analysis rule. The category for the attribute. The identifier of the analysis rule the attribute applies to. Gets the category identifying the classification of the attribute. The property describes the tool or tool analysis category for which a message suppression attribute applies. Gets the identifier of the analysis tool rule to be suppressed. Concatenated together, the and properties form a unique check identifier. Gets or sets the scope of the code that is relevant for the attribute. The Scope property is an optional argument that specifies the metadata scope for which the attribute is relevant. Gets or sets a fully qualified path that represents the target of the attribute. The property is an optional argument identifying the analysis target of the attribute. An example value is "System.IO.Stream.ctor():System.Void". Because it is fully qualified, it can be long, particularly for targets such as parameters. The analysis tool user interface should be capable of automatically formatting the parameter. Gets or sets an optional argument expanding on exclusion criteria. The property is an optional argument that specifies additional exclusion where the literal metadata target is not sufficiently precise. For example, the cannot be applied within a method, and it may be desirable to suppress a violation against a statement in the method that will give a rule violation, but not against all statements in the method. Gets or sets the justification for suppressing the code analysis message. Indicates that certain members on a specified are accessed dynamically, for example through . This allows tools to understand which members are being accessed during the execution of a program. This attribute is valid on members whose type is or . When this attribute is applied to a location of type , the assumption is that the string represents a fully qualified type name. When this attribute is applied to a class, interface, or struct, the members specified can be accessed dynamically on instances returned from calling on instances of that class, interface, or struct. If the attribute is applied to a method it's treated as a special case and it implies the attribute should be applied to the "this" parameter of the method. As such the attribute should only be used on instance methods of types assignable to System.Type (or string, but no methods will use it there). Initializes a new instance of the class with the specified member types. The types of members dynamically accessed. Gets the which specifies the type of members dynamically accessed. Specifies the types of members that are dynamically accessed. This enumeration has a attribute that allows a bitwise combination of its member values. Specifies no members. Specifies the default, parameterless public constructor. Specifies all public constructors. Specifies all non-public constructors. Specifies all public methods. Specifies all non-public methods. Specifies all public fields. Specifies all non-public fields. Specifies all public nested types. Specifies all non-public nested types. Specifies all public properties. Specifies all non-public properties. Specifies all public events. Specifies all non-public events. Specifies all interfaces implemented by the type. Specifies all non-public constructors, including those inherited from base classes. Specifies all non-public methods, including those inherited from base classes. Specifies all non-public fields, including those inherited from base classes. Specifies all non-public nested types, including those inherited from base classes. Specifies all non-public properties, including those inherited from base classes. Specifies all non-public events, including those inherited from base classes. Specifies all public constructors, including those inherited from base classes. Specifies all public nested types, including those inherited from base classes. Specifies all constructors, including those inherited from base classes. Specifies all methods, including those inherited from base classes. Specifies all fields, including those inherited from base classes. Specifies all nested types, including those inherited from base classes. Specifies all properties, including those inherited from base classes. Specifies all events, including those inherited from base classes. Specifies all members. Specifies that null is allowed as an input even if the corresponding type disallows it. Specifies that null is disallowed as an input even if the corresponding type allows it. Specifies that an output may be null even if the corresponding type disallows it. Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns. Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. Initializes the attribute with the specified return value condition. The return value condition. If the method returns this value, the associated parameter may be null. Gets the return value condition. Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. Initializes the attribute with the specified return value condition. The return value condition. If the method returns this value, the associated parameter will not be null. Gets the return value condition. Specifies that the output will be non-null if the named parameter is non-null. Initializes the attribute with the associated parameter name. The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null. Gets the associated parameter name. Applied to a method that will never return under any circumstance. Specifies that the method will not return if the associated Boolean parameter is passed the specified value. Initializes the attribute with the specified parameter value. The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to the associated parameter matches this value. Gets the condition parameter value. Specifies that the method or property will ensure that the listed field and property members have not-null values. Initializes the attribute with a field or property member. The field or property member that is promised to be not-null. Initializes the attribute with the list of field and property members. The list of field and property members that are promised to be not-null. Gets field or property member names. Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. Initializes the attribute with the specified return value condition and a field or property member. The return value condition. If the method returns this value, the associated field or property member will not be null. The field or property member that is promised to be not-null. Initializes the attribute with the specified return value condition and list of field and property members. The return value condition. If the method returns this value, the associated field and property members will not be null. The list of field and property members that are promised to be not-null. Gets the return value condition. Gets field or property member names. When applied to an attribute class, instructs the compiler to flow applications of that attribute, from source code down to compiler-generated symbols. This can help IL-based analysis tools. One example where this attribute applies is in C# primary constructor parameters. If an attribute marked with gets applied to a primary constructor parameter, the attribute will also be applied to any compiler-generated fields storing that parameter. Initializes a new instance of the class. Attribute used to indicate a source generator should create a function for marshalling arguments instead of relying on the runtime to generate an equivalent marshalling function at run-time. This attribute is meaningless if the source generator associated with it is not enabled. The current built-in source generator only supports C# and only supplies an implementation when applied to static, partial, non-generic methods. Initializes a new instance of the . Name of the library containing the import. Gets the name of the library containing the import. Gets or sets the name of the entry point to be called. Gets or sets how to marshal string arguments to the method. If this field is set to a value other than , must not be specified. Gets or sets the used to control how string arguments to the method are marshalled. If this field is specified, must not be specified or must be set to . Gets or sets whether the callee sets an error (SetLastError on Windows or errno on other platforms) before returning from the attributed method. Specifies how strings should be marshalled for generated p/invokes Indicates the user is supplying a specific marshaller in . Use the platform-provided UTF-8 marshaller. Use the platform-provided UTF-16 marshaller. Base type for all platform-specific API attributes. Records the platform that the project targeted. Records the operating system (and minimum version) that supports an API. Multiple attributes can be applied to indicate support on multiple operating systems. Callers can apply a or use guards to prevent calls to APIs on unsupported operating systems. A given platform should only be specified once. Marks APIs that were removed in a given operating system version. Primarily used by OS bindings to indicate APIs that are only available in earlier versions. Marks APIs that were obsoleted in a given operating system version. Primarily used by OS bindings to indicate APIs that should not be used anymore. Initializes a new instance of the class with the specified platform name. The name of the platform where the API was obsoleted. Initializes a new instance of the class with the specified platform name and message. The name of the platform where the API was obsoleted. The message that explains the obsolescence. Gets the message that explains the obsolescence. Gets or sets the URL that provides more information about the obsolescence. Annotates a custom guard field, property or method with a supported platform name and optional version. Multiple attributes can be applied to indicate guard for multiple supported platforms. Callers can apply a to a field, property or method and use that field, property or method in a conditional or assert statements in order to safely call platform specific APIs. The type of the field or property should be boolean, the method return type should be boolean in order to be used as platform guard. Annotates the custom guard field, property or method with an unsupported platform name and optional version. Multiple attributes can be applied to indicate guard for multiple unsupported platforms. Callers can apply a to a field, property or method and use that field, property or method in a conditional or assert statements as a guard to safely call APIs unsupported on those platforms. The type of the field or property should be boolean, the method return type should be boolean in order to be used as platform guard. The application name changed from "{0}" to "{1}". Changing host configuration is not supported. The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will no ... Build can only be called once. The content root changed from "{0}" to "{1}". Changing host configuration is not supported. CreateBuilder must be called before CreateServiceProvider The environment name changed from "{0}" to "{1}". Changing host configuration is not supported. Replacing IHostApplicationLifetime is not supported. The IServiceProviderFactory returned a null IServiceProvider The resolver returned a null IServiceProviderFactory Provides downlevel polyfills for static methods on Exception-derived types.