From 182d3e791124a74b0c5207fe12e08c09f583ad7c Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 2 Jun 2025 14:08:40 +0100 Subject: [PATCH 1/2] Upgrade to .NET 9.0 and update dependencies This commit upgrades the target framework from .NET 8.0 to .NET 9.0 across multiple project files, including `CallbackHandler.Testing.csproj` and `CallbackHandler.BusinessLogic.Tests.csproj`. Several NuGet packages have been updated to their latest versions for compatibility, including `Microsoft.NET.Test.Sdk` and `MediatR`. GitHub Actions workflows have been modified to install .NET 9.0 using `actions/setup-dotnet`, ensuring the correct version is used for builds and tests. The Dockerfile has been updated to use .NET 9.0 base images. Minor changes in `BankDepositCallback.feature.cs` include the addition of `global::` to certain namespaces to avoid naming conflicts. Overall, these changes ensure that all components are aligned with .NET 9.0 and compatible with the latest libraries. --- .github/workflows/createrelease.yml | 5 ++ .github/workflows/nightlybuild.yml | 5 ++ .github/workflows/pullrequest.yml | 5 ++ .github/workflows/pushtomain.yml | 5 ++ .../CallbackHander.Testing.csproj | 6 +- ...CallbackHandler.BusinessLogic.Tests.csproj | 8 +-- .../CallbackHandler.BusinessLogic.csproj | 10 +-- ...andler.CallbackMessage.DomainEvents.csproj | 6 +- ...dler.CallbackMessageAggregate.Tests.csproj | 8 +-- ...ackHandler.CallbackMessageAggregate.csproj | 10 +-- ...CallbackHandler.DataTransferObjects.csproj | 2 +- .../CallbackHandler.IntegrationTests.csproj | 14 ++--- .../Features/BankDepositCallback.feature.cs | 62 ++++++++++++------- .../CallbackHandler.Tests.csproj | 12 ++-- CallbackHandler/CallbackHandler.csproj | 32 +++++----- CallbackHandler/Dockerfile | 4 +- .../CallbackHandlers.Models.csproj | 2 +- 17 files changed, 118 insertions(+), 78 deletions(-) diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml index 9131308..a105dc5 100644 --- a/.github/workflows/createrelease.yml +++ b/.github/workflows/createrelease.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml index 58c90a5..4a410be 100644 --- a/.github/workflows/nightlybuild.yml +++ b/.github/workflows/nightlybuild.yml @@ -16,6 +16,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Set Up Variables run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index b6670da..8c83909 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -16,6 +16,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Restore Nuget Packages run: dotnet restore CallbackHandler.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} diff --git a/.github/workflows/pushtomain.yml b/.github/workflows/pushtomain.yml index 2a5c22b..0b47a52 100644 --- a/.github/workflows/pushtomain.yml +++ b/.github/workflows/pushtomain.yml @@ -19,6 +19,11 @@ jobs: with: fetch-depth: 0 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Restore Nuget Packages run: dotnet restore CallbackHandler.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} diff --git a/CallbackHander.Testing/CallbackHander.Testing.csproj b/CallbackHander.Testing/CallbackHander.Testing.csproj index fb6694b..358b200 100644 --- a/CallbackHander.Testing/CallbackHander.Testing.csproj +++ b/CallbackHander.Testing/CallbackHander.Testing.csproj @@ -1,15 +1,15 @@  - net8.0 + net9.0 None false - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj b/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj index 4ec0409..580c035 100644 --- a/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj +++ b/CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj @@ -1,18 +1,18 @@  - net8.0 + net9.0 None false - + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler.BusinessLogic/CallbackHandler.BusinessLogic.csproj b/CallbackHandler.BusinessLogic/CallbackHandler.BusinessLogic.csproj index e6110cb..15c8f0c 100644 --- a/CallbackHandler.BusinessLogic/CallbackHandler.BusinessLogic.csproj +++ b/CallbackHandler.BusinessLogic/CallbackHandler.BusinessLogic.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 - - - - + + + + diff --git a/CallbackHandler.CallbackMessage.DomainEvents/CallbackHandler.CallbackMessage.DomainEvents.csproj b/CallbackHandler.CallbackMessage.DomainEvents/CallbackHandler.CallbackMessage.DomainEvents.csproj index 0e2353d..7b2cfd4 100644 --- a/CallbackHandler.CallbackMessage.DomainEvents/CallbackHandler.CallbackMessage.DomainEvents.csproj +++ b/CallbackHandler.CallbackMessage.DomainEvents/CallbackHandler.CallbackMessage.DomainEvents.csproj @@ -1,11 +1,11 @@  - net8.0 + net9.0 None - - + + \ No newline at end of file diff --git a/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj b/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj index 77ff87c..ad5c1ec 100644 --- a/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj +++ b/CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj @@ -1,18 +1,18 @@  - net8.0 + net9.0 None false - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler.CallbackMessageAggregate/CallbackHandler.CallbackMessageAggregate.csproj b/CallbackHandler.CallbackMessageAggregate/CallbackHandler.CallbackMessageAggregate.csproj index 1c724aa..21b2317 100644 --- a/CallbackHandler.CallbackMessageAggregate/CallbackHandler.CallbackMessageAggregate.csproj +++ b/CallbackHandler.CallbackMessageAggregate/CallbackHandler.CallbackMessageAggregate.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 @@ -9,9 +9,9 @@ - - - - + + + + \ No newline at end of file diff --git a/CallbackHandler.DataTransferObjects/CallbackHandler.DataTransferObjects.csproj b/CallbackHandler.DataTransferObjects/CallbackHandler.DataTransferObjects.csproj index 54b85fb..55da1c7 100644 --- a/CallbackHandler.DataTransferObjects/CallbackHandler.DataTransferObjects.csproj +++ b/CallbackHandler.DataTransferObjects/CallbackHandler.DataTransferObjects.csproj @@ -1,7 +1,7 @@ - net8.0;netstandard2.1 + net9.0 None diff --git a/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj b/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj index 7c7485f..6a7bfb9 100644 --- a/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj +++ b/CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -9,14 +9,14 @@ - - - + + + - - - + + + diff --git a/CallbackHandler.IntegrationTests/Features/BankDepositCallback.feature.cs b/CallbackHandler.IntegrationTests/Features/BankDepositCallback.feature.cs index 3afbc03..7e66770 100644 --- a/CallbackHandler.IntegrationTests/Features/BankDepositCallback.feature.cs +++ b/CallbackHandler.IntegrationTests/Features/BankDepositCallback.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace CallbackHandler.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("BankDepositCallback")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class BankDepositCallbackFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "BankDepositCallback", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "BankDepositCallback", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "BankDepositCallback.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,22 +96,22 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Process a Bank Deposit Callback")] - public async System.Threading.Tasks.Task ProcessABankDepositCallback() + public async global::System.Threading.Tasks.Task ProcessABankDepositCallback() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Process a Bank Deposit Callback", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 4 this.ScenarioInitialize(scenarioInfo); diff --git a/CallbackHandler.Tests/CallbackHandler.Tests.csproj b/CallbackHandler.Tests/CallbackHandler.Tests.csproj index 6e775b6..013c9e3 100644 --- a/CallbackHandler.Tests/CallbackHandler.Tests.csproj +++ b/CallbackHandler.Tests/CallbackHandler.Tests.csproj @@ -1,19 +1,19 @@  - net8.0 + net9.0 false - - - - + + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CallbackHandler/CallbackHandler.csproj b/CallbackHandler/CallbackHandler.csproj index 4697613..3ce15e4 100644 --- a/CallbackHandler/CallbackHandler.csproj +++ b/CallbackHandler/CallbackHandler.csproj @@ -1,27 +1,27 @@  - net8.0 + net9.0 Linux - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/CallbackHandler/Dockerfile b/CallbackHandler/Dockerfile index bd7fdd6..7cc52bb 100644 --- a/CallbackHandler/Dockerfile +++ b/CallbackHandler/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src COPY ["CallbackHandler/NuGet.Config", "."] COPY ["CallbackHandler/CallbackHandler.csproj", "CallbackHandler/"] diff --git a/CallbackHandlers.Models/CallbackHandlers.Models.csproj b/CallbackHandlers.Models/CallbackHandlers.Models.csproj index 95ce5f9..2d908e7 100644 --- a/CallbackHandlers.Models/CallbackHandlers.Models.csproj +++ b/CallbackHandlers.Models/CallbackHandlers.Models.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 From b754bdd44de9fce380e066646afcf76174f256c2 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 2 Jun 2025 14:09:01 +0100 Subject: [PATCH 2/2] Update .NET SDK version in Dockerfile Upgraded the base image for the build stage from `mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022` to `mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022` to leverage new features and improvements in .NET 9.0. --- CallbackHandler/Dockerfilewindows | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CallbackHandler/Dockerfilewindows b/CallbackHandler/Dockerfilewindows index d18e798..a963417 100644 --- a/CallbackHandler/Dockerfilewindows +++ b/CallbackHandler/Dockerfilewindows @@ -2,7 +2,7 @@ FROM stuartferguson/txnprocbasewindows AS base USER ContainerAdministrator WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build WORKDIR /src COPY ["CallbackHandler/NuGet.Config", "."] COPY ["CallbackHandler/CallbackHandler.csproj", "CallbackHandler/"]