Repository: dotnet/aspnetcore
File: src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs (C#)

Code before:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ServiceProcess;

namespace Microsoft.AspNetCore.Hosting.WindowsServices;

/// <summary>
///     Extensions to <see cref="IWebHost"/> for hosting inside a Windows service.
/// </summary>
[Obsolete("Use UseWindowsService and AddHostedService instead.", DiagnosticId = "ASPDEPR009")]
public static class WebHostWindowsServiceExtensions
{
    /// <summary>
    ///     Runs the specified web application inside a Windows service and blocks until the service is stopped.
    /// </summary>
    /// <param name="host">An instance of the <see cref="IWebHost"/> to host in the Windows service.</param>
    /// <example>
    ///     This example shows how to use <see cref="RunAsService"/>.
    ///     <code>
    ///         public class Program
    ///         {
    ///             public static void Main(string[] args)
    ///             {
    ///                 var config = WebHostConfiguration.GetDefault(args);
    ///
    ///                 var host = new WebHostBuilder()
    ///                     .UseConfiguration(config)
    ///                     .Build();
    ///
    ///                 // This call will block until the service is stopped.
    ///                 host.RunAsService();
    ///             }
    ///         }
    ///     </code>
    /// </example>

Review comment (suggestion):
```suggestion
[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009")]
```

Code after:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.ServiceProcess;

namespace Microsoft.AspNetCore.Hosting.WindowsServices;

/// <summary>
///     Extensions to <see cref="IWebHost"/> for hosting inside a Windows service.
/// </summary>
[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009")]
public static class WebHostWindowsServiceExtensions
{
    /// <summary>
    ///     Runs the specified web application inside a Windows service and blocks until the service is stopped.
    /// </summary>
    /// <param name="host">An instance of the <see cref="IWebHost"/> to host in the Windows service.</param>
    /// <example>
    ///     This example shows how to use <see cref="RunAsService"/>.
    ///     <code>
    ///         public class Program
    ///         {
    ///             public static void Main(string[] args)
    ///             {
    ///                 var config = WebHostConfiguration.GetDefault(args);
    ///
    ///                 var host = new WebHostBuilder()
    ///                     .UseConfiguration(config)
    ///                     .Build();
    ///
    ///                 // This call will block until the service is stopped.
    ///                 host.RunAsService();
    ///             }
    ///         }
    ///     </code>
    /// </example>