</Target>
<PropertyGroup Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'">
- <NoWarn>$(NoWarn);1591</NoWarn>
<IntellisensePackageXmlRootFolder>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</IntellisensePackageXmlRootFolder>
<IntellisensePackageXmlFilePathFromNetFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromNetFolder>
<IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath>
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder))">$(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder)</IntellisensePackageXmlFilePath>
+ <!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" compiler errors if
+ - the intellisense package xml file is used or
+ - the assembly is private (i.e. System.Private.Uri) or
+ - the assembly is a PNSE assembly. -->
+ <NoWarn Condition="'$(IntellisensePackageXmlFilePath)' != '' or
+ '$(IsPrivateAssembly)' == 'true' or
+ '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum);netstandard2.1</TargetFrameworks>
+ <!-- Public API not fully documented. -->
+ <NoWarn>$(NoWarn);1591</NoWarn>
<IsPackable>true</IsPackable>
<!-- This assembly should never be placed inbox as it is only for downlevel compatibility. -->
<PackageDescription>Provides the IAsyncEnumerable<T> and IAsyncDisposable interfaces and helper types for .NET Standard 2.0. This package is not required starting with .NET Standard 2.1 and .NET Core 3.0.
<IsTrimmable>false</IsTrimmable>
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
<NoWarn>$(NoWarn);CA1852</NoWarn>
+ <!-- Public API not fully documented. -->
+ <NoWarn>$(NoWarn);1591</NoWarn>
<IsPackable>true</IsPackable>
<PackageDescription>Suite of xUnit.net tests to check for container compatibility with Microsoft.Extensions.DependencyInjection.</PackageDescription>
<!-- this assembly doesn't need to be binplaced -->
/// <summary>
/// Check if the current process is hosted as a systemd Service.
/// </summary>
- /// <returns><c>True</c> if the current process is hosted as a systemd Service, otherwise <c>false</c>.</returns>
+ /// <returns>
+ /// <see langword="true" /> if the current process is hosted as a systemd Service; otherwise, <see langword="false" />.
+ /// </returns>
public static bool IsSystemdService()
=> _isSystemdService ??= GetIsSystemdService();
private ILogger Logger { get; }
private ISystemdNotifier SystemdNotifier { get; }
+ /// <summary>
+ /// Asynchronously stops and shuts down the host. This method is called from <see cref="IHost.StopAsync(CancellationToken)" />.
+ /// </summary>
+ /// <param name="cancellationToken">
+ /// A cancellation token that indicates when stop should no longer be graceful.
+ /// </param>
+ /// <returns>
+ /// A task that represents the asynchronous stop operation.
+ /// </returns>
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
+ /// <summary>
+ /// Asynchronously waits until the start operation is complete before continuing. This method is called at the beginning of <see cref="IHost.StartAsync(CancellationToken)" />. This can be used to delay startup until signaled by an external event.
+ /// </summary>
+ /// <param name="cancellationToken">
+ /// A cancellation token that indicates when stop should no longer be graceful.
+ /// </param>
+ /// <returns>
+ /// A task that represents the waiting for start operation.
+ /// </returns>
public Task WaitForStartAsync(CancellationToken cancellationToken)
{
_applicationStartedRegistration = ApplicationLifetime.ApplicationStarted.Register(state =>
SystemdNotifier.Notify(ServiceState.Stopping);
}
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
public void Dispose()
{
UnregisterShutdownHandlers();
namespace Microsoft.Extensions.Hosting.Systemd
{
+ /// <summary>
+ /// Provides support to notify systemd about the service status.
+ /// </summary>
[UnsupportedOSPlatform("browser")]
public class SystemdNotifier : ISystemdNotifier
{
/// <summary>
/// Check if the current process is hosted as a Windows Service.
/// </summary>
- /// <returns><c>True</c> if the current process is hosted as a Windows Service, otherwise <c>false</c>.</returns>
+ /// <returns>
+ /// <see langword="true" /> if the current process is hosted as a Windows Service; otherwise, <see langword="false" />.
+ /// </returns>
[SupportedOSPlatformGuard("windows")]
public static bool IsWindowsService()
{
private IHostEnvironment Environment { get; }
private ILogger Logger { get; }
+ /// <summary>
+ /// Asynchronously waits until start is complete before continuing. This method is called at the beginning of <see cref="IHost.StartAsync(CancellationToken)" />. This can be used to delay startup until signaled by an external event.
+ /// </summary>
+ /// <param name="cancellationToken">
+ /// A cancellation token that indicates when stop should no longer be graceful.
+ /// </param>
+ /// <returns>
+ /// A task that represents the asynchronous waiting for start operation.
+ /// </returns>
public Task WaitForStartAsync(CancellationToken cancellationToken)
{
cancellationToken.Register(() => _delayStart.TrySetCanceled());
}
/// <summary>
- /// Called from <see cref="IHost.StopAsync"/> to stop the service if not already stopped, and wait for the service dispatcher to exit.
- /// Once this method returns the service is stopped and the process can be terminated at any time.
+ /// Asynchronously stops and shuts down the host. This method is called from <see cref="IHost.StopAsync(CancellationToken)" />.
/// </summary>
+ /// <param name="cancellationToken">
+ /// A cancellation token that indicates when stop should no longer be graceful.
+ /// </param>
+ /// <returns>
+ /// A task that represents the asynchronous stop operation.
+ /// </returns>
public async Task StopAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
namespace Microsoft.Extensions.Hosting
{
+ /// <summary>
+ /// Options to configure the lifetime of a windows service.
+ /// </summary>
public class WindowsServiceLifetimeOptions
{
/// <summary>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppToolCurrent);$(NetFrameworkToolCurrent)</TargetFrameworks>
+ <AssemblyName>Microsoft.NETCore.Platforms.BuildTasks</AssemblyName>
+
+ <!-- Opt out of features that aren't necessary for a local build task. -->
<Nullable>disable</Nullable>
<EnableBinPlacing>false</EnableBinPlacing>
<!-- This project should not build against the live built .NETCoreApp targeting pack as it contributes to the build itself. -->
<UseLocalTargetingRuntimePack>false</UseLocalTargetingRuntimePack>
- <AssemblyName>Microsoft.NETCore.Platforms.BuildTasks</AssemblyName>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
+ <GenerateDocumentationFile>false</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<PackageId>$(MSBuildProjectName)</PackageId>
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <!-- Public API not fully documented. -->
+ <NoWarn>$(NoWarn);1591</NoWarn>
<IsPackable>true</IsPackable>
<PackageDescription>Tensor class which represents and extends multi-dimensional arrays.
<NoWarn>$(NoWarn);CS0649;SA1129;IDE0059;IDE0060;CA1822;CA1852</NoWarn>
<Nullable>annotations</Nullable>
<IsTrimmable>false</IsTrimmable>
+ <!-- Public API not fully documented. -->
+ <NoWarn>$(NoWarn);1591</NoWarn>
<IsPackable>true</IsPackable>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<IsPackable>true</IsPackable>