Skip to content

Commit 324c0b6

Browse files
authored
Target .NET 9 (#797)
* Target .NET 9 * .NET 9 SDK on Pipeline * Tweak build * Fix * ReleaseNotes.md
1 parent 95d39dc commit 324c0b6

File tree

13 files changed

+14
-50
lines changed

13 files changed

+14
-50
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup .NET
5252
uses: actions/setup-dotnet@v4
5353
with:
54-
dotnet-version: 8.0.x
54+
dotnet-version: 9.0.x
5555
- name: Cache NuGet
5656
uses: actions/cache@v4
5757
with:

Directory.Build.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0;net8.0;net9.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<LangVersion>preview</LangVersion>
@@ -23,8 +23,6 @@
2323
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory).ruleset</CodeAnalysisRuleSet>
2424
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
2525
<AnalysisLevel>preview</AnalysisLevel>
26-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
27-
<WarningsNotAsErrors>NU5104;NU1507;NU1903</WarningsNotAsErrors>
2826
</PropertyGroup>
2927
<ItemGroup>
3028
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.401",
3+
"version": "9.0.100",
44
"rollForward": "latestMinor",
55
"allowPrerelease": false
66
}

src/ModularPipelines.Build/Modules/RunUnitTestsModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class RunUnitTestsModule : Module<CommandResult[]>
2626
{
2727
Project = unitTestProjectFile.Path,
2828
NoBuild = true,
29-
Framework = "net8.0",
29+
Framework = "net9.0",
3030
Arguments = ["--coverage", "--coverage-output-format", "cobertura"],
3131
Configuration = Configuration.Release,
3232
EnvironmentVariables = new Dictionary<string, string?>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add target for .NET 9

test/ModularPipelines.Azure.UnitTests/ModularPipelines.Azure.UnitTests.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-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<OutputType>Exe</OutputType>

test/ModularPipelines.TestHelpers/ModularPipelines.TestHelpers.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-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>

test/ModularPipelines.TestsForTests/ModularPipelines.TestsForTests.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-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>

test/ModularPipelines.UnitTests/Helpers/DotNetTestResultsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private class DotNetTestWithFailureModule : Module<CommandResult>
2525
return await context.DotNet().Test(new DotNetTestOptions
2626
{
2727
ProjectSolutionDirectoryDllExe = testProject,
28-
Framework = "net8.0",
28+
Framework = "net9.0",
2929
CommandLogging = CommandLogging.Error,
3030
}, token: cancellationToken);
3131
}
@@ -44,7 +44,7 @@ private class DotNetTestWithoutFailureModule : Module<CommandResult>
4444
{
4545
ProjectSolutionDirectoryDllExe = testProject,
4646
Filter = "TestCategory=Pass",
47-
Framework = "net8.0",
47+
Framework = "net9.0",
4848
CommandLogging = CommandLogging.Error,
4949
Logger = [$"trx;LogFileName={TrxFile}"]
5050
}, token: cancellationToken);

test/ModularPipelines.UnitTests/ModularPipelines.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-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
<OutputType>Exe</OutputType>
66
</PropertyGroup>

test/ModularPipelines.UnitTests/PipelineWriterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override async Task<GitHubPipelineFileWriterOptions> GetGitHubPipelineFil
4646
PipelineProjectPath = RandomFilePath.Path!,
4747
Environment = "${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}",
4848
CacheNuGet = true,
49-
DotNetRunFramework = "net8.0",
49+
DotNetRunFramework = "net9.0",
5050
ValuesToMask =
5151
[
5252
"${{ secrets.DOTNET_FORMAT_PUSH_TOKEN }}", "${{ secrets.NuGet__ApiKey }}",
@@ -134,7 +134,7 @@ await Assert.That((await RandomFilePath.ReadAsync()).Trim()).
134134
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
135135
restore-keys: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
136136
- name: Run Pipeline
137-
run: dotnet run -c Release --framework net8.0 {{{RandomFilePath}}}
137+
run: dotnet run -c Release --framework net9.0 {{{RandomFilePath}}}
138138
env:
139139
DOTNET_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
140140
NuGet__ApiKey: ${{ secrets.NuGet__ApiKey }}

test/ModularPipelines.UnitTests/TrxParsingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class NUnitModule : Module<DotNetTestResult>
2626
await context.DotNet().Test(new DotNetTestOptions
2727
{
2828
ProjectSolutionDirectoryDllExe = testProject,
29-
Framework = "net8.0",
29+
Framework = "net9.0",
3030
CommandLogging = CommandLogging.Error,
3131
Logger = [$"trx;logfilename={trxFile}"],
3232
ThrowOnNonZeroExitCode = false

0 commit comments

Comments
 (0)