Skip to content

Commit 0482ea5

Browse files
committed
Cleanup frameworks for .NET 9
1 parent 06289e9 commit 0482ea5

6 files changed

Lines changed: 44 additions & 7 deletions

File tree

src/WsjtxUtils.WsjtxMessages/WsjtxUtils.WsjtxMessages.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>True</GenerateDocumentationFile>

src/WsjtxUtils.WsjtxUdpServer.Example.UpdateGridFromGPS/WsjtxUtils.WsjtxUdpServer.Example.UpdateGridFromGPS.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -16,6 +16,11 @@
1616
<RepositoryType>git</RepositoryType>
1717
</PropertyGroup>
1818

19+
<!-- suppress “package not tested on this TFM” for net7 & net6 -->
20+
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net6.0'">
21+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
22+
</PropertyGroup>
23+
1924
<ItemGroup>
2025
<None Include="..\..\LICENSE" Link="LICENSE">
2126
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/WsjtxUtils.WsjtxUdpServer.Example.WriteJsonToConsole/WsjtxUtils.WsjtxUdpServer.Example.WriteJsonToConsole.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -16,6 +16,11 @@
1616
<RepositoryType>git</RepositoryType>
1717
</PropertyGroup>
1818

19+
<!-- suppress “package not tested on this TFM” for net7 & net6 -->
20+
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net6.0'">
21+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
22+
</PropertyGroup>
23+
1924
<ItemGroup>
2025
<None Include="..\..\LICENSE" Link="LICENSE">
2126
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/WsjtxUtils.WsjtxUdpServer/WsjtxUtils.WsjtxUdpServer.csproj

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>True</GenerateDocumentationFile>
@@ -39,7 +39,21 @@
3939
</ItemGroup>
4040

4141
<ItemGroup>
42-
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.4" />
42+
<!-- for .NET 9 -->
43+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.4"
44+
Condition="'$(TargetFramework)' == 'net9.0'" />
45+
46+
<!-- for .NET 8 -->
47+
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1"
48+
Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'" />
49+
50+
<!-- for .NET 6 -->
51+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.1"
52+
Condition="'$(TargetFramework)' == 'net6.0'" />
53+
54+
<!-- for .NET Framework 4.8 use the Abstractions package (or your lowest-supported version) -->
55+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4"
56+
Condition="'$(TargetFramework)' == 'net48'" />
4357
</ItemGroup>
4458

4559
</Project>

tests/WsjtxUtils.WsjtxMessages.Tests/WsjtxUtils.WsjtxMessages.Tests.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
<Nullable>enable</Nullable>
55
<LangVersion>latest</LangVersion>
66
<IsPackable>false</IsPackable>
7-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
7+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
8+
<!-- disable null-analysis warnings CS8600 & CS8602 in tests -->
9+
<NoWarn>$(NoWarn);CS8600;CS8602</NoWarn>
10+
</PropertyGroup>
11+
12+
<!-- suppress “package not tested on this TFM” for net7 & net6 -->
13+
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net6.0'">
14+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
815
</PropertyGroup>
916

1017
<ItemGroup>

tests/WsjtxUtils.WsjtxUdpServer.Tests/WsjtxUtils.WsjtxUdpServer.Tests.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
<Nullable>enable</Nullable>
55
<LangVersion>latest</LangVersion>
66
<IsPackable>false</IsPackable>
7-
<TargetFrameworks>net9.0;net8.0;net48</TargetFrameworks>
7+
<TargetFrameworks>net6.0;net8.0;net9.0;net48</TargetFrameworks>
8+
<NoWarn>$(NoWarn);CS8600;CS8602</NoWarn>
9+
</PropertyGroup>
10+
11+
<!-- suppress “package not tested on this TFM” for net7 & net6 -->
12+
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net6.0'">
13+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
814
</PropertyGroup>
915

1016
<ItemGroup>

0 commit comments

Comments
 (0)