use TargetFrameworkIdentifier

this doesn't work in Directory.Build.props, moved it to Directory.Build.targets.
This commit is contained in:
Marius Thesing
2025-02-02 19:39:38 +01:00
parent a0bb44cec3
commit 076ede161d
4 changed files with 10 additions and 8 deletions
-7
View File
@@ -28,13 +28,6 @@
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
<!--
Disable nullable warnings on old frameworks because of missing annotations.
-->
<PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
<NoWarn>$(NoWarn);CS8602;CS8604;CS8777</NoWarn>
</PropertyGroup>
<!--
Add the stylecop config to each project.
-->
+8
View File
@@ -0,0 +1,8 @@
<Project>
<!--
Disable nullable warnings on old frameworks because of missing annotations.
-->
<PropertyGroup Condition=" '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
<NoWarn>$(NoWarn);nullable</NoWarn>
</PropertyGroup>
</Project>
+1
View File
@@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
stylecop.json = stylecop.json
THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
version.json = version.json
Directory.Build.targets = Directory.Build.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC}"
+1 -1
View File
@@ -36,7 +36,7 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
<PropertyGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">
<IsTrimmable>true</IsTrimmable>
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>