WebHostWindowsServiceExtensions Class¶
Extensions toMicrosoft.AspNetCore.Hosting.IWebHost
for hosting inside a Windows service.
- Namespace
Microsoft.AspNetCore.Hosting.WindowsServices
- Assemblies
- Microsoft.AspNetCore.Hosting.WindowsServices
Syntax¶
public class WebHostWindowsServiceExtensions
-
class
Microsoft.AspNetCore.Hosting.WindowsServices.
WebHostWindowsServiceExtensions
Methods¶
-
RunAsService
(Microsoft.AspNetCore.Hosting.IWebHost)¶ - Runs the specified web application inside a Windows service and blocks until the service is stopped.
Arguments: host (Microsoft.AspNetCore.Hosting.IWebHost) – An instance of the Microsoft.AspNetCore.Hosting.IWebHost
to host in the Windows service.public static void RunAsService(this IWebHost host)
-