KestrunHostManager.Create method (1 of 3)

Creates a new KestrunHost instance using the provided factory function.

public static KestrunHost Create(string name, Func<KestrunHost> factory, bool setAsDefault = false)
parameter description
name The name of the KestrunHost instance to create.
factory A factory function that returns a new KestrunHost instance.
setAsDefault Whether to set this instance as the default.

Return Value

The created KestrunHost instance.

See Also


KestrunHostManager.Create method (2 of 3)

Creates a new KestrunHost instance with the specified name and optional module paths, using the default logger.

public static KestrunHost Create(string name, string[]? modulePathsObj = null, 
    bool setAsDefault = false)
parameter description
name The name of the KestrunHost instance to create.
modulePathsObj Optional array of module paths to load.
setAsDefault Whether to set this instance as the default.

Return Value

The created KestrunHost instance.

See Also


KestrunHostManager.Create method (3 of 3)

Creates a new KestrunHost instance with the specified name, logger, root path, and optional module paths.

public static KestrunHost Create(string name, ILogger logger, string[]? modulePathsObj = null, 
    bool setAsDefault = false)
parameter description
name The name of the KestrunHost instance to create.
logger The Serilog logger to use for the host.
modulePathsObj Optional array of module paths to load.
setAsDefault Whether to set this instance as the default.

Return Value

The created KestrunHost instance.

See Also