diff --git a/Source/MSBuild.Sdk.Extras/Build/Platforms.targets b/Source/MSBuild.Sdk.Extras/Build/Platforms.targets index a8b80a8..9606451 100644 --- a/Source/MSBuild.Sdk.Extras/Build/Platforms.targets +++ b/Source/MSBuild.Sdk.Extras/Build/Platforms.targets @@ -42,7 +42,8 @@ - + + false $(ImplicitFrameworkIdentifierDefine) diff --git a/Tests/ImplicitFrameworkDefines/Class1.cs b/Tests/ImplicitFrameworkDefines/Class1.cs new file mode 100644 index 0000000..201ffae --- /dev/null +++ b/Tests/ImplicitFrameworkDefines/Class1.cs @@ -0,0 +1,18 @@ +using System; + +namespace ImplicitFrameworkDefines +{ + public class TestClass + { +#if !NET8_0 && !NET8_0_OR_GREATER +#error NET8_0 and NET8_0_OR_GREATER must be defined +#endif + +#if NET8_0_WINDOWS + // This should only compile for net8.0-windows + public const string Platform = "Windows"; +#else + public const string Platform = "CrossPlatform"; +#endif + } +} diff --git a/Tests/ImplicitFrameworkDefines/ImplicitFrameworkDefines.csproj b/Tests/ImplicitFrameworkDefines/ImplicitFrameworkDefines.csproj new file mode 100644 index 0000000..e07592f --- /dev/null +++ b/Tests/ImplicitFrameworkDefines/ImplicitFrameworkDefines.csproj @@ -0,0 +1,18 @@ + + + + + + net8.0;net8.0-windows + Library + + + + + + + + + + +