Skip to content

Commit db2b121

Browse files
authored
Add .NET Standard 2.1 (#424)
1 parent e67be50 commit db2b121

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

src/CommandLineUtils/IO/Pager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Pager(IConsole console)
4545
#if NET45
4646
// if .NET Framework, assume we're on Windows unless it's running on Mono.
4747
_enabled = Type.GetType("Mono.Runtime") != null;
48-
#elif NETSTANDARD2_0
48+
#elif NETSTANDARD2_0 || NETSTANDARD2_1
4949
_enabled = !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !console.IsOutputRedirected;
5050
#else
5151
#error Update target frameworks

src/CommandLineUtils/Internal/Util.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private static class EmptyArrayCache<T>
1616
internal static readonly T[] Value = new T[0];
1717
}
1818

19-
#elif NETSTANDARD2_0
19+
#elif NETSTANDARD2_0 || NETSTANDARD2_1
2020
=> Array.Empty<T>();
2121
#else
2222
#error Update target frameworks

src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;netstandard2.0;net45</TargetFrameworks>
5+
<Nullable Condition="'$(TargetFramework)' != 'netstandard2.1'">annotations</Nullable>
56
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
<IsPackable>true</IsPackable>
78
<Description>Command-line parsing API.</Description>
@@ -20,7 +21,7 @@ McMaster.Extensions.CommandLineUtils.ArgumentEscaper
2021
<PackageTags>commandline;parsing</PackageTags>
2122
</PropertyGroup>
2223

23-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
24+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
2425
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
2526
</ItemGroup>
2627

src/CommandLineUtils/Utilities/DotNetExe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static string FullPathOrDefault()
4545
var fileName = FileName;
4646
#if NET45
4747
fileName += ".exe";
48-
#elif NETSTANDARD2_0
48+
#elif NETSTANDARD2_0 || NETSTANDARD2_1
4949
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
5050
{
5151
fileName += ".exe";

src/Hosting.CommandLine/McMaster.Extensions.Hosting.CommandLine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66
<IsPackable>true</IsPackable>
77
<Description>Provides command-line parsing API integration with the generic host API (Microsoft.Extensions.Hosting).</Description>

test/CommandLineUtils.Tests/DotNetExeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// This file has been modified from the original form. See Notice.txt in the project root for more information.
55

6-
#if NETCOREAPP
6+
#if NETCOREAPP || NET5_0
77
using System.IO;
88
using Xunit;
99

0 commit comments

Comments
 (0)