共用方式為


SystemdHostBuilderExtensions.UseSystemd(IHostBuilder) 方法

定義

IHost 存留期設定為 SystemdLifetime、提供應用程式啟動和停止的通知訊息,並將主控台記錄設定為系統化格式。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseSystemd(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder);
public static Microsoft.Extensions.Hosting.IHostBuilder UseSystemd (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
static member UseSystemd : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseSystemd (hostBuilder As IHostBuilder) As IHostBuilder

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilder

傳回

用於鏈結的 hostBuilder 實例。

備註

這是內容感知,只有在偵測到進程以 systemd Service 執行時才會啟動。

系統服務檔案必須設定為 Type=notify,才能啟用通知。 請參閱 https://www.freedesktop.org/software/systemd/man/systemd.service.html.

適用於