Skip to content

Commit

Permalink
Add missed net5/net6 TFMs (#1740)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r authored Mar 13, 2023
1 parent a3c8294 commit eb1f802
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/CallerArgumentExpressionAttribute.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/HealthChecks.Network/DnsResolveHealthCheck.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,7 +22,7 @@ public async Task<HealthCheckResult> 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);
Expand Down
6 changes: 3 additions & 3 deletions src/HealthChecks.Network/DnsResolveHostCountHealthCheck.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -26,8 +26,8 @@ public async Task<HealthCheckResult> 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
Expand Down
2 changes: 1 addition & 1 deletion src/HealthChecks.Network/HealthChecks.Network.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5;net6</TargetFrameworks>
<PackageTags>$(PackageTags);Network;Sftp;Ftp;Tcp;DNS</PackageTags>
<Description>HealthChecks.Network is the health check package for network services.</Description>
<VersionPrefix>$(HealthCheckNetwork)</VersionPrefix>
Expand Down
2 changes: 1 addition & 1 deletion src/HealthChecks.Network/SslHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public async Task<HealthCheckResult> 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
Expand Down
2 changes: 1 addition & 1 deletion src/HealthChecks.Uris/HealthChecks.Uris.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5</TargetFrameworks>
<PackageTags>$(PackageTags);Uri;Url;Uris;Urls</PackageTags>
<Description>HealthChecks.Uris is a simple health check package for Uri groups.</Description>
<VersionPrefix>$(HealthCheckUri)</VersionPrefix>
Expand Down

0 comments on commit eb1f802

Please sign in to comment.