From 7ad09bdbd331dc5a79f7ccbf78480fcccf992ca2 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Thu, 12 Nov 2026 16:47:03 -0600 Subject: [PATCH] Target net10.0 and net11.0, fix CI - Target net10.0;net11.0 with per-TFM Microsoft.Extensions/EF Core versions - Install .NET 10 and 11 SDKs in workflows - Remove dead NET8_0_OR_GREATER branches - Bump Microsoft.* 10.0.x pins to 10.0.15 and Aspire.Hosting.AppHost to 13.6.5 - Drop stale Tracker.Shared Mediator.Abstractions rc pin that failed restore (NU1605) - Use Microsoft.Testing.Platform runner (global.json, dotnet test --solution) - Disable generated endpoints in Endpoints.Tests and fix stale CreateModel assertion --- .github/workflows/build.yml | 6 +++-- .github/workflows/copilot-setup-steps.yml | 4 ++- .vscode/launch.json | 4 +-- Directory.Packages.props | 26 +++++++++---------- global.json | 10 +++++++ .../Tracker.Shared/Tracker.Shared.csproj | 2 +- .../Foundatio.CommandQuery.Dispatcher.csproj | 17 +++++------- .../Foundatio.CommandQuery.Endpoints.csproj | 2 +- .../ProblemDetailsCustomizer.cs | 12 +-------- ...ndatio.CommandQuery.EntityFramework.csproj | 12 +++------ .../Foundatio.CommandQuery.MongoDB.csproj | 2 +- .../Foundatio.CommandQuery.csproj | 2 +- .../DispatchRequestTests.cs | 2 +- .../EntityCommandEndpointBaseTests.cs | 2 ++ 14 files changed, 50 insertions(+), 53 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f88d31b..4c1974d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,9 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v6 with: - dotnet-version: 10.x + dotnet-version: | + 10.x + 11.x - name: Restore Dependencies run: dotnet restore @@ -46,7 +48,7 @@ jobs: run: dotnet build --no-restore --configuration Release - name: Run Test - run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings + run: dotnet test --solution Foundatio.CommandQuery.slnx --no-build --configuration Release - name: Create Packages if: success() && github.event_name != 'pull_request' diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index f7b3664..250a665 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -23,4 +23,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v6 with: - dotnet-version: 10.0.x + dotnet-version: | + 10.0.x + 11.0.x diff --git a/.vscode/launch.json b/.vscode/launch.json index 794b5fa..18ff599 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/samples/EntityFramework/Tracker.Host/bin/Debug/net9.0/Tracker.Host.dll", + "program": "${workspaceFolder}/samples/EntityFramework/Tracker.Host/bin/Debug/net10.0/Tracker.Host.dll", "args": [], "cwd": "${workspaceFolder}/samples/EntityFramework/Tracker.Host", "stopAtEntry": false, @@ -26,7 +26,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/samples/MongoDB/Tracker.Service/bin/Debug/net9.0/Tracker.WebService.dll", + "program": "${workspaceFolder}/samples/MongoDB/Tracker.Service/bin/Debug/net10.0/Tracker.WebService.dll", "args": [], "cwd": "${workspaceFolder}/samples/MongoDB/Tracker.Service", "stopAtEntry": false, diff --git a/Directory.Packages.props b/Directory.Packages.props index 7be36d9..5476908 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ false - + @@ -17,19 +17,19 @@ - - - - - - - + + + + + + + - - - - - + + + + + diff --git a/global.json b/global.json new file mode 100644 index 0000000..8a204b5 --- /dev/null +++ b/global.json @@ -0,0 +1,10 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "latestMajor", + "allowPrerelease": false + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/samples/EntityFramework/Tracker.Shared/Tracker.Shared.csproj b/samples/EntityFramework/Tracker.Shared/Tracker.Shared.csproj index e0102a9..9df4dc2 100644 --- a/samples/EntityFramework/Tracker.Shared/Tracker.Shared.csproj +++ b/samples/EntityFramework/Tracker.Shared/Tracker.Shared.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Foundatio.CommandQuery.Dispatcher/Foundatio.CommandQuery.Dispatcher.csproj b/src/Foundatio.CommandQuery.Dispatcher/Foundatio.CommandQuery.Dispatcher.csproj index a348187..572384b 100644 --- a/src/Foundatio.CommandQuery.Dispatcher/Foundatio.CommandQuery.Dispatcher.csproj +++ b/src/Foundatio.CommandQuery.Dispatcher/Foundatio.CommandQuery.Dispatcher.csproj @@ -1,25 +1,20 @@  - net8.0;net9.0;net10.0 + net10.0;net11.0 enable enable Dispatcher implementation for Command Query Responsibility Segregation (CQRS) framework providing centralized command and query handling with caching support - - + + - - - - - - - - + + + diff --git a/src/Foundatio.CommandQuery.Endpoints/Foundatio.CommandQuery.Endpoints.csproj b/src/Foundatio.CommandQuery.Endpoints/Foundatio.CommandQuery.Endpoints.csproj index e370e8e..cd9cbd1 100644 --- a/src/Foundatio.CommandQuery.Endpoints/Foundatio.CommandQuery.Endpoints.csproj +++ b/src/Foundatio.CommandQuery.Endpoints/Foundatio.CommandQuery.Endpoints.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0;net10.0 + net10.0;net11.0 enable enable ASP.NET Core Minimal API endpoints for Command Query Responsibility Segregation (CQRS) framework providing HTTP-based command and query execution diff --git a/src/Foundatio.CommandQuery.Endpoints/ProblemDetailsCustomizer.cs b/src/Foundatio.CommandQuery.Endpoints/ProblemDetailsCustomizer.cs index 34b496b..bcb8f34 100644 --- a/src/Foundatio.CommandQuery.Endpoints/ProblemDetailsCustomizer.cs +++ b/src/Foundatio.CommandQuery.Endpoints/ProblemDetailsCustomizer.cs @@ -60,22 +60,12 @@ public static void CustomizeProblemDetails(ProblemDetailsContext context) private static Exception? GetException(ProblemDetailsContext context) { -#if NET8_0_OR_GREATER - var exception = context.Exception; -#else - var feature = context.HttpContext.Features.Get(); - var exception = feature?.Error; -#endif - return exception; + return context.Exception; } private static void AddValidationErrors(ProblemDetailsContext context, IDictionary errors) { -#if NET8_0_OR_GREATER context.ProblemDetails = new HttpValidationProblemDetails(errors); -#else - context.ProblemDetails.Extensions.Add("errors", errors); -#endif } /// diff --git a/src/Foundatio.CommandQuery.EntityFramework/Foundatio.CommandQuery.EntityFramework.csproj b/src/Foundatio.CommandQuery.EntityFramework/Foundatio.CommandQuery.EntityFramework.csproj index a96e3c7..b587e41 100644 --- a/src/Foundatio.CommandQuery.EntityFramework/Foundatio.CommandQuery.EntityFramework.csproj +++ b/src/Foundatio.CommandQuery.EntityFramework/Foundatio.CommandQuery.EntityFramework.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0;net10.0 + net10.0;net11.0 enable enable Entity Framework Core integration for Command Query Responsibility Segregation (CQRS) framework providing database query and persistence handlers with dynamic LINQ support @@ -12,15 +12,11 @@ - + - - - - - - + + diff --git a/src/Foundatio.CommandQuery.MongoDB/Foundatio.CommandQuery.MongoDB.csproj b/src/Foundatio.CommandQuery.MongoDB/Foundatio.CommandQuery.MongoDB.csproj index 626fb35..17a2b64 100644 --- a/src/Foundatio.CommandQuery.MongoDB/Foundatio.CommandQuery.MongoDB.csproj +++ b/src/Foundatio.CommandQuery.MongoDB/Foundatio.CommandQuery.MongoDB.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0;net10.0 + net10.0;net11.0 enable enable MongoDB integration for Command Query Responsibility Segregation (CQRS) framework providing NoSQL database query and persistence handlers with dynamic LINQ support diff --git a/src/Foundatio.CommandQuery/Foundatio.CommandQuery.csproj b/src/Foundatio.CommandQuery/Foundatio.CommandQuery.csproj index 4c41a20..9a61666 100644 --- a/src/Foundatio.CommandQuery/Foundatio.CommandQuery.csproj +++ b/src/Foundatio.CommandQuery/Foundatio.CommandQuery.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0;net10.0 + net10.0;net11.0 enable enable Core abstractions and base classes for implementing Command Query Responsibility Segregation (CQRS) patterns using the mediator pattern diff --git a/tests/Foundatio.CommandQuery.Dispatcher.Tests/DispatchRequestTests.cs b/tests/Foundatio.CommandQuery.Dispatcher.Tests/DispatchRequestTests.cs index f0bb3ce..5ee5768 100644 --- a/tests/Foundatio.CommandQuery.Dispatcher.Tests/DispatchRequestTests.cs +++ b/tests/Foundatio.CommandQuery.Dispatcher.Tests/DispatchRequestTests.cs @@ -174,7 +174,7 @@ public void JsonSerialization_SerializedJsonHasCorrectStructure() json.Should().Contain("\"model\":"); json.Should().Contain($"\"id\":\"structure-test\""); json.Should().Contain("CreateEntity"); // Just check that the type name contains the command name - json.Should().Contain("EntityCreateModel"); // And the model type + json.Should().Contain("CreateModel"); // And the model type } [Fact] diff --git a/tests/Foundatio.CommandQuery.Endpoints.Tests/EntityCommandEndpointBaseTests.cs b/tests/Foundatio.CommandQuery.Endpoints.Tests/EntityCommandEndpointBaseTests.cs index 381ea44..b79f9b0 100644 --- a/tests/Foundatio.CommandQuery.Endpoints.Tests/EntityCommandEndpointBaseTests.cs +++ b/tests/Foundatio.CommandQuery.Endpoints.Tests/EntityCommandEndpointBaseTests.cs @@ -10,6 +10,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +[assembly: MediatorConfiguration(EndpointDiscovery = EndpointDiscovery.None)] + namespace Foundatio.CommandQuery.Endpoints.Tests; public class EntityCommandEndpointBaseTests