KestrunHostManager.Create method (1 of 3)

Creates a new KestrunHost instance using the provided factory function.

public static KestrunHost Create(string name, string entryScriptPath, Func<KestrunHost> factory, 
    bool setAsDefault = false, bool enablePowershellMiddleware = false)
parameter description
name The name of the KestrunHost instance to create.
entryScriptPath The path of the entry script that invoked this creation.
factory A factory function that returns a new KestrunHost instance.
setAsDefault Whether to set this instance as the default.
enablePowershellMiddleware Whether to enable PowerShell middleware for this instance.

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 entryScriptPath, 
    string[]? modulePathsObj = null, bool setAsDefault = false, 
    bool enablePowershellMiddleware = false)
parameter description
name The name of the KestrunHost instance to create.
entryScriptPath The path of the entry script that invoked this creation.
modulePathsObj Optional array of module paths to load.
setAsDefault Whether to set this instance as the default.
enablePowershellMiddleware Whether to enable PowerShell middleware for this instance.

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 entryScriptPath, 
    string[]? modulePathsObj = null, bool setAsDefault = false, 
    bool enablePowershellMiddleware = false)
parameter description
name The name of the KestrunHost instance to create.
logger The Serilog logger to use for the host.
entryScriptPath The path of the entry script that invoked this creation.
modulePathsObj Optional array of module paths to load.
setAsDefault Whether to set this instance as the default.
enablePowershellMiddleware Whether to enable PowerShell middleware for this instance.

Return Value

The created KestrunHost instance.

See Also