Skip to content

Commit c532b77

Browse files
authored
Drop support for .NET 7.0, add support for .NET 9.0 (#299)
1 parent 13f30c1 commit c532b77

File tree

10 files changed

+46
-34
lines changed

10 files changed

+46
-34
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ env:
1717
BuildPlatform: 'Any CPU'
1818
ContinuousIntegrationBuild: 'true'
1919
DotNet6Version: '6.x'
20-
DotNet7Version: '7.x'
2120
DotNet8Version: '8.x'
21+
DotNet9Version: '9.x'
2222

2323
jobs:
2424
BuildAndTest:
@@ -39,18 +39,23 @@ jobs:
3939

4040
steps:
4141
- name: Checkout
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 0
4545

46-
- name: Install .NET ${{ env.DotNet6Version }}, .NET ${{ env.DotNet7Version }}, and .NET ${{ env.DotNet8Version }}
47-
uses: actions/setup-dotnet@v3
46+
- name: Install .NET ${{ env.DotNet6Version }} and .NET ${{ env.DotNet8Version }}
47+
uses: actions/setup-dotnet@v4
4848
with:
4949
dotnet-version: |
5050
${{ env.DotNet6Version }}
51-
${{ env.DotNet7Version }}
5251
${{ env.DotNet8Version }}
5352
53+
- name: Install .NET ${{ env.DotNet9Version }}
54+
uses: actions/setup-dotnet@v4
55+
with:
56+
dotnet-version: ${{ env.DotNet9Version }}
57+
dotnet-quality: 'preview'
58+
5459
- name: Build Solution
5560
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/build.binlog"
5661

@@ -62,22 +67,22 @@ jobs:
6267
if: ${{ matrix.name != 'MacOS' }}
6368
run: dotnet test --logger trx --no-restore --no-build --framework net6.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net6.0.binlog"
6469

65-
- name: Run Unit Tests (.NET 7)
66-
run: dotnet test --logger trx --no-restore --no-build --framework net7.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net7.0.binlog"
67-
6870
- name: Run Unit Tests (.NET 8)
6971
run: dotnet test --logger trx --no-restore --no-build --framework net8.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net8.0.binlog"
72+
73+
- name: Run Unit Tests (.NET 9)
74+
run: dotnet test --logger trx --no-restore --no-build --framework net9.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net9.0.binlog"
7075

7176
- name: Upload Test Results
72-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v4
7378
if: success() || failure()
7479
with:
7580
name: test-results-${{ matrix.name }}
7681
path: '**/TestResults/*.trx'
7782
if-no-files-found: error
7883

7984
- name: Upload Artifacts
80-
uses: actions/upload-artifact@v2
85+
uses: actions/upload-artifact@v4
8186
if: success() || failure()
8287
with:
8388
name: ${{ env.ArtifactsDirectoryName }}-${{ matrix.name }}

.github/workflows/Official.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ env:
1616
ContinuousIntegrationBuild: 'true'
1717
OfficialBuild: 'true'
1818
DotNet6Version: '6.x'
19-
DotNet7Version: '7.x'
2019
DotNet8Version: '8.x'
2120

2221
jobs:
@@ -26,23 +25,28 @@ jobs:
2625

2726
steps:
2827
- name: Checkout
29-
uses: actions/checkout@v2
28+
uses: actions/checkout@v4
3029
with:
3130
fetch-depth: 0
3231

33-
- name: Install .NET ${{ env.DotNet6Version }},.NET ${{ env.DotNet7Version }}, and .NET ${{ env.DotNet8Version }}
34-
uses: actions/setup-dotnet@v3
32+
- name: Install .NET ${{ env.DotNet6Version }} and .NET ${{ env.DotNet8Version }}
33+
uses: actions/setup-dotnet@v4
3534
with:
3635
dotnet-version: |
3736
${{ env.DotNet6Version }}
38-
${{ env.DotNet7Version }}
3937
${{ env.DotNet8Version }}
4038
39+
- name: Install .NET ${{ env.DotNet9Version }}
40+
uses: actions/setup-dotnet@v4
41+
with:
42+
dotnet-version: ${{ env.DotNet9Version }}
43+
dotnet-quality: 'preview'
44+
4145
- name: Build Solution
4246
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}\build.binlog"
4347

4448
- name: Upload Artifacts
45-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v4
4650
if: success() || failure()
4751
with:
4852
name: ${{ env.ArtifactsDirectoryName }}

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5-
<MicrosoftBuildPackageVersion>17.10.4</MicrosoftBuildPackageVersion>
5+
<MicrosoftBuildPackageVersion>17.11.4</MicrosoftBuildPackageVersion>
66
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net6.0'">17.3.2</MicrosoftBuildPackageVersion>
7-
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net7.0'">17.7.2</MicrosoftBuildPackageVersion>
8-
<NuGetPackageVersion>6.7.0</NuGetPackageVersion>
97
</PropertyGroup>
108
<ItemGroup>
119
<PackageVersion Include="AssemblyShader" Version="1.0.3-preview" />
1210
<PackageVersion Include="Microsoft.Build" Version="$(MicrosoftBuildPackageVersion)" />
1311
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildPackageVersion)" />
14-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
12+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
1513
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
14+
<PackageVersion Include="Microsoft.IO.Redist" Version="6.0.1" />
1615
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
17-
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.10.2154" />
16+
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.11.2177" />
1817
<PackageVersion Include="Shouldly" Version="4.2.1" />
1918
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
19+
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
2020
<PackageVersion Include="xunit" Version="2.9.0" />
2121
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
2222
</ItemGroup>
2323
<ItemGroup>
2424
<GlobalPackageReference Include="Microsoft.Build.Artifacts" Version="6.1.30" />
2525
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
26-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" />
26+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.143" />
2727
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
2828
<Compile Include="..\Shared\GlobalSuppressions.cs" />
2929
<AdditionalFiles Include="..\Shared\stylecop.json" />

global.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
4-
"rollForward": "latestMinor"
3+
"version": "9.0",
4+
"rollForward": "latestMinor",
5+
"allowPrerelease": true
56
}
67
}

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/Microsoft.Build.Utilities.ProjectCreation.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0;net8.0;net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
</PropertyGroup>
66
<Import Project="..\Microsoft.Build.Utilities.ProjectCreation\build\MSBuild.ProjectCreation.props" Condition="'$(TargetFramework)' == 'net472'" />

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/TestBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public string DotNetSdkVersion
2020
get =>
2121
#if NET6_0
2222
"6.0.100";
23-
#elif NET7_0
24-
"7.0.100";
2523
#elif NET8_0 || NETFRAMEWORK
2624
"8.0.100";
25+
#elif NET9_0 || NETFRAMEWORK
26+
"9.0.0";
2727
#else
28-
Unknown target framework!
28+
#error Unknown target framework!
2929
#endif
3030
}
3131

@@ -34,14 +34,14 @@ public string TargetFramework
3434
get =>
3535
#if NET6_0
3636
"net6.0";
37-
#elif NET7_0
38-
"net7.0";
3937
#elif NET8_0
4038
"net8.0";
39+
#elif NET9_0
40+
"net9.0";
4141
#elif NETFRAMEWORK
4242
"net472";
4343
#else
44-
Unknown target framework!
44+
#error Unknown target framework!
4545
#endif
4646
}
4747

src/Microsoft.Build.Utilities.ProjectCreation/Microsoft.Build.Utilities.ProjectCreation.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0;net8.0;net9.0</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<ArtifactsPath>..\..\artifacts\$(MSBuildProjectName)</ArtifactsPath>
@@ -29,9 +29,11 @@
2929
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" />
3030
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
3131
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" Condition="'$(OfficialBuild)' != 'true'" />
32+
<PackageReference Include="Microsoft.IO.Redist" Condition="'$(TargetFramework)' == 'net472'" />
3233
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Runtime" PrivateAssets="All" />
33-
<PackageReference Include="System.ValueTuple" VersionOverride="4.5.0" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Compile" />
3434
<PackageReference Include="System.IO.Compression" Condition="'$(TargetFramework)' == 'net472'" />
35+
<PackageReference Include="System.Text.Json" Condition="'$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'" />
36+
<PackageReference Include="System.ValueTuple" VersionOverride="4.5.0" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Compile" />
3537
</ItemGroup>
3638
<ItemGroup>
3739
<EmbeddedResource Update="Strings.resx">

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "12.1",
2+
"version": "13.0",
33
"assemblyVersion": "1.0",
44
"buildNumberOffset": -1,
55
"nugetPackageVersion": {

0 commit comments

Comments
 (0)