.NET Platform Conditional Tags in .csproj

In addition to symbols you can use in code, one can also use TFMs in .csproj files for instance to decide which references to use depending on target framework, like so:

1   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
2      <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
3   </ItemGroup>

Here is the list of all the TFMs known today:

Target FrameworkTFM
.NET 5 (and .NET Core)netcoreapp1.0; netcoreapp1.1; netcoreapp2.0; netcoreapp2.1; netcoreapp2.2; netcoreapp3.0; netcoreapp3.1; net5.0
.NET Standardnetstandard1.0; netstandard1.1; netstandard1.2; netstandard1.3; netstandard1.4; netstandard1.5; netstandard1.6; netstandard2.0; netstandard2.1
.NET Frameworknet11; net20; net35; net40; net403; net45; net451; net452; net46; net461; net462; net47; net471; net472; net48
Windows Storenetcore; netcore45; win; win8; netcore451; win81
.NET Micro Frameworknetmf
Silverlightsl4; sl5
Windows Phonewp; wp7; wp75; wp8; wp81; wpa81
Universal Windows Platformuap; uap10.0; win10; netcore50

Have feedback or questions? Feel free to email me.