Skip to content

Commit 076ede1

Browse files
committed
use TargetFrameworkIdentifier
this doesn't work in Directory.Build.props, moved it to Directory.Build.targets.
1 parent a0bb44c commit 076ede1

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Directory.Build.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
2929
</PropertyGroup>
3030

31-
<!--
32-
Disable nullable warnings on old frameworks because of missing annotations.
33-
-->
34-
<PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
35-
<NoWarn>$(NoWarn);CS8602;CS8604;CS8777</NoWarn>
36-
</PropertyGroup>
37-
3831
<!--
3932
Add the stylecop config to each project.
4033
-->

Directory.Build.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<!--
3+
Disable nullable warnings on old frameworks because of missing annotations.
4+
-->
5+
<PropertyGroup Condition=" '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
6+
<NoWarn>$(NoWarn);nullable</NoWarn>
7+
</PropertyGroup>
8+
</Project>

Renci.SshNet.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2121
stylecop.json = stylecop.json
2222
THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
2323
version.json = version.json
24+
Directory.Build.targets = Directory.Build.targets
2425
EndProjectSection
2526
EndProject
2627
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC}"

src/Renci.SshNet/Renci.SshNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3737
</PropertyGroup>
3838

39-
<PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
39+
<PropertyGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">
4040
<IsTrimmable>true</IsTrimmable>
4141
<IsAotCompatible>true</IsAotCompatible>
4242
</PropertyGroup>

0 commit comments

Comments
 (0)