diff --git a/src/CallerArgumentExpressionAttribute.cs b/src/CallerArgumentExpressionAttribute.cs index 7ffde0f83c..6e354dadfb 100644 --- a/src/CallerArgumentExpressionAttribute.cs +++ b/src/CallerArgumentExpressionAttribute.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -#if !NET6_0_OR_GREATER +#if !NET5_0_OR_GREATER namespace System.Runtime.CompilerServices { diff --git a/src/HealthChecks.Network/DnsResolveHealthCheck.cs b/src/HealthChecks.Network/DnsResolveHealthCheck.cs index 8d25ac0fec..7489dca2cd 100644 --- a/src/HealthChecks.Network/DnsResolveHealthCheck.cs +++ b/src/HealthChecks.Network/DnsResolveHealthCheck.cs @@ -1,5 +1,5 @@ using System.Net; -#if !NET5_0_OR_GREATER +#if !NET6_0_OR_GREATER using HealthChecks.Network.Extensions; #endif using Microsoft.Extensions.Diagnostics.HealthChecks; @@ -22,7 +22,7 @@ public async Task CheckHealthAsync(HealthCheckContext context { foreach (var item in _options.ConfigureHosts.Values) { -#if NET5_0_OR_GREATER +#if NET6_0_OR_GREATER var ipAddresses = await Dns.GetHostAddressesAsync(item.Host, cancellationToken).ConfigureAwait(false); #else var ipAddresses = await Dns.GetHostAddressesAsync(item.Host).WithCancellationTokenAsync(cancellationToken).ConfigureAwait(false); diff --git a/src/HealthChecks.Network/DnsResolveHostCountHealthCheck.cs b/src/HealthChecks.Network/DnsResolveHostCountHealthCheck.cs index 24f805b604..3c90b2a5f9 100644 --- a/src/HealthChecks.Network/DnsResolveHostCountHealthCheck.cs +++ b/src/HealthChecks.Network/DnsResolveHostCountHealthCheck.cs @@ -1,5 +1,5 @@ using System.Net; -#if !NET5_0_OR_GREATER +#if !NET6_0_OR_GREATER using HealthChecks.Network.Extensions; #endif using Microsoft.Extensions.Diagnostics.HealthChecks; @@ -26,8 +26,8 @@ public async Task CheckHealthAsync(HealthCheckContext context { var (minHosts, maxHosts) = entry.Value; -#if NET5_0_OR_GREATER - var ipAddresses = await Dns.GetHostAddressesAsync(entry.Key, cancellationToken); +#if NET6_0_OR_GREATER + var ipAddresses = await Dns.GetHostAddressesAsync(entry.Key, cancellationToken).ConfigureAwait(false); #else var ipAddresses = await Dns.GetHostAddressesAsync(entry.Key).WithCancellationTokenAsync(cancellationToken).ConfigureAwait(false); #endif diff --git a/src/HealthChecks.Network/HealthChecks.Network.csproj b/src/HealthChecks.Network/HealthChecks.Network.csproj index 586d9cc5d8..eaf4f1931f 100644 --- a/src/HealthChecks.Network/HealthChecks.Network.csproj +++ b/src/HealthChecks.Network/HealthChecks.Network.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net5;net6 $(PackageTags);Network;Sftp;Ftp;Tcp;DNS HealthChecks.Network is the health check package for network services. $(HealthCheckNetwork) diff --git a/src/HealthChecks.Network/SslHealthCheck.cs b/src/HealthChecks.Network/SslHealthCheck.cs index 426dd3005c..bc349c71f7 100644 --- a/src/HealthChecks.Network/SslHealthCheck.cs +++ b/src/HealthChecks.Network/SslHealthCheck.cs @@ -26,7 +26,7 @@ public async Task CheckHealthAsync(HealthCheckContext context { using var tcpClient = new TcpClient(_options.AddressFamily); #if NET5_0_OR_GREATER - await tcpClient.ConnectAsync(host, port, cancellationToken); + await tcpClient.ConnectAsync(host, port, cancellationToken).ConfigureAwait(false); #else await tcpClient.ConnectAsync(host, port).WithCancellationTokenAsync(cancellationToken).ConfigureAwait(false); #endif diff --git a/src/HealthChecks.Uris/HealthChecks.Uris.csproj b/src/HealthChecks.Uris/HealthChecks.Uris.csproj index 584f89d4a4..e45f557626 100644 --- a/src/HealthChecks.Uris/HealthChecks.Uris.csproj +++ b/src/HealthChecks.Uris/HealthChecks.Uris.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net5 $(PackageTags);Uri;Url;Uris;Urls HealthChecks.Uris is a simple health check package for Uri groups. $(HealthCheckUri)