Service Lifetime Host Builder Extensions. Use Windows Service Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the host lifetime to WindowsServiceLifetime, sets the Content Root, and enables logging to the event log with the application name as the default source name.
public: [System::Runtime::CompilerServices::Extension] static Microsoft::Extensions::Hosting::IHostBuilder ^ UseWindowsService(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder);
public static Microsoft.Extensions.Hosting.IHostBuilder UseWindowsService (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
static member UseWindowsService : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()> Public Function UseWindowsService (hostBuilder As IHostBuilder) As IHostBuilder
The same instance of the IHostBuilder for chaining.
This is context aware and will only activate if it detects the process is running as a Windows Service.