diff --git a/src/CommandLineUtils/IO/Pager.cs b/src/CommandLineUtils/IO/Pager.cs index 92951176..9aa7da7e 100644 --- a/src/CommandLineUtils/IO/Pager.cs +++ b/src/CommandLineUtils/IO/Pager.cs @@ -45,7 +45,7 @@ public Pager(IConsole console) #if NET45 // if .NET Framework, assume we're on Windows unless it's running on Mono. _enabled = Type.GetType("Mono.Runtime") != null; -#elif NETSTANDARD2_0 +#elif NETSTANDARD2_0 || NETSTANDARD2_1 _enabled = !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !console.IsOutputRedirected; #else #error Update target frameworks diff --git a/src/CommandLineUtils/Internal/Util.cs b/src/CommandLineUtils/Internal/Util.cs index 943aa53f..8a11fdfd 100644 --- a/src/CommandLineUtils/Internal/Util.cs +++ b/src/CommandLineUtils/Internal/Util.cs @@ -16,7 +16,7 @@ private static class EmptyArrayCache internal static readonly T[] Value = new T[0]; } -#elif NETSTANDARD2_0 +#elif NETSTANDARD2_0 || NETSTANDARD2_1 => Array.Empty(); #else #error Update target frameworks diff --git a/src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj b/src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj index fbed55fc..40c5d683 100644 --- a/src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj +++ b/src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj @@ -1,7 +1,8 @@  - netstandard2.0;net45 + netstandard2.1;netstandard2.0;net45 + annotations true true Command-line parsing API. @@ -20,7 +21,7 @@ McMaster.Extensions.CommandLineUtils.ArgumentEscaper commandline;parsing - + diff --git a/src/CommandLineUtils/Utilities/DotNetExe.cs b/src/CommandLineUtils/Utilities/DotNetExe.cs index 14e88cff..73d20585 100644 --- a/src/CommandLineUtils/Utilities/DotNetExe.cs +++ b/src/CommandLineUtils/Utilities/DotNetExe.cs @@ -45,7 +45,7 @@ public static string FullPathOrDefault() var fileName = FileName; #if NET45 fileName += ".exe"; -#elif NETSTANDARD2_0 +#elif NETSTANDARD2_0 || NETSTANDARD2_1 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { fileName += ".exe"; diff --git a/src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj b/src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj index c17a9713..3173729b 100644 --- a/src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj +++ b/src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.1;netstandard2.0 true true Provides command-line parsing API integration with the generic host API (Microsoft.Extensions.Hosting). diff --git a/test/CommandLineUtils.Tests/DotNetExeTests.cs b/test/CommandLineUtils.Tests/DotNetExeTests.cs index 96b13d1b..3b9a9aca 100644 --- a/test/CommandLineUtils.Tests/DotNetExeTests.cs +++ b/test/CommandLineUtils.Tests/DotNetExeTests.cs @@ -3,7 +3,7 @@ // This file has been modified from the original form. See Notice.txt in the project root for more information. -#if NETCOREAPP +#if NETCOREAPP || NET5_0 using System.IO; using Xunit;