Skip to content

Instantly share code, notes, and snippets.

@moh-hassan
Created April 8, 2019 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moh-hassan/0ce9433adc66b521e6b215b243af2af2 to your computer and use it in GitHub Desktop.
Save moh-hassan/0ce9433adc66b521e6b215b243af2af2 to your computer and use it in GitHub Desktop.
define constant in msbuild project: NETFRAMEWORK, NETSTANDARD and NETCORE
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
</PropertyGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment