Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CommandLineUtils/IO/Pager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLineUtils/Internal/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static class EmptyArrayCache<T>
internal static readonly T[] Value = new T[0];
}

#elif NETSTANDARD2_0
#elif NETSTANDARD2_0 || NETSTANDARD2_1
=> Array.Empty<T>();
#else
#error Update target frameworks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;net45</TargetFrameworks>
<Nullable Condition="'$(TargetFramework)' != 'netstandard2.1'">annotations</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<Description>Command-line parsing API.</Description>
Expand All @@ -20,7 +21,7 @@ McMaster.Extensions.CommandLineUtils.ArgumentEscaper
<PackageTags>commandline;parsing</PackageTags>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/CommandLineUtils/Utilities/DotNetExe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
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.1;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<Description>Provides command-line parsing API integration with the generic host API (Microsoft.Extensions.Hosting).</Description>
Expand Down
2 changes: 1 addition & 1 deletion test/CommandLineUtils.Tests/DotNetExeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down