Skip to content

Instantly share code, notes, and snippets.

@harujoh
Created September 23, 2020 01:09
Show Gist options
  • Save harujoh/0ac7908e64c10fa58b5a1a7bb77f69e2 to your computer and use it in GitHub Desktop.
Save harujoh/0ac7908e64c10fa58b5a1a7bb77f69e2 to your computer and use it in GitHub Desktop.
NetStandardのバージョン判定
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<DefineConstants Condition="$(TargetFramework.Contains('netstandard')) and $(TargetFramework.Length) > 12 and
$([System.Version]::Parse('$(TargetFramework.Replace('netstandard',''))').CompareTo($([System.Version]::Parse('2.1')))) >= 0">
NETSTANDARD2_1_OR_GREATER
</DefineConstants>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment