Skip to content

Upgrade Chapter 3 to .NET 10#231

Merged
kamilbaczek merged 7 commits intomainfrom
copilot/upgrade-chapter-3-to-dotnet-10
Jan 24, 2026
Merged

Upgrade Chapter 3 to .NET 10#231
kamilbaczek merged 7 commits intomainfrom
copilot/upgrade-chapter-3-to-dotnet-10

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 12, 2025

📋 Description

Upgrades Chapter 3 (microservice extraction) projects from .NET 9 to .NET 10. This includes framework target updates, package version bumps, replacement of deprecated API methods, CI/CD pipeline updates, and build error fixes.

Framework & Package Updates

  • TargetFramework: net9.0net10.0 in all Directory.Build.props files
  • Microsoft packages: Updated to 10.0.1 (AspNetCore.OpenApi, EntityFrameworkCore, Extensions.*)
  • Npgsql.EntityFrameworkCore.PostgreSQL: 9.0.4 → 10.0.0
  • Swashbuckle.AspNetCore: 9.0.4 → 10.0.1
  • Microsoft.OpenApi: Added 2.3.0 (required for Swashbuckle 10.0.1)

API Deprecation Fixes

Replaced deprecated WithOpenApi() method with WithSummary() and WithDescription() in all endpoint definitions:

// Before (.NET 9)
.WithOpenApi(operation => new(operation)
{
    Summary = "Returns all passes that exist in the system",
    Description = "This endpoint is used to retrieve all existing passes."
})

// After (.NET 10)
.WithSummary("Returns all passes that exist in the system")
.WithDescription("This endpoint is used to retrieve all existing passes.")

CI/CD Pipeline Updates

Updated all GitHub Actions workflow files to use .NET 10.0.x SDK:

  • chapter-3-workflow.yml
  • chapter-3-contracts-workflow.yml
  • chapter-3-package-workflow.yml
  • chapter-3-contracts-package-workflow.yml

Build Error Fixes

NU1510 Error: Fixed by removing redundant Microsoft.AspNetCore.Http.Abstractions package reference from Fitnet.Contracts.Infrastructure.csproj. The package is already included via FrameworkReference to Microsoft.AspNetCore.App. In .NET 10 with TreatWarningsAsErrors enabled, redundant package references are treated as errors.

IDE0055 Formatting Errors: Fixed formatting issues in six migration files by:

  • Adding missing blank line between namespace declaration and using statements
  • Adding missing using System.Diagnostics.CodeAnalysis; statement for the [ExcludeFromCodeCoverage] attribute

Affected migration files in Fitnet.Contracts:

  • 20230601184153_MakeSignedAtColumnNullable.cs
  • 20230601184328_AddCustomerIdColumn.cs
  • 20230624171216_ContractsAddColumnsToSupportContractExpiration.cs

Affected migration files in Fitnet:

  • 20230503180337_CreateOffersTable.cs
  • 20230503180338_CreatePassesTable.cs
  • 20250927073029_AddMissingForeignKeys.cs

CS1587 Error: Fixed XML documentation comment placement in 20250927073029_AddMissingForeignKeys.cs by moving the /// <inheritdoc /> comment before the [ExcludeFromCodeCoverage] attribute. XML comments must be placed before all attributes on a class declaration.

Affected Projects

  • Fitnet.Common (6 projects) - ✅ Builds successfully, tests pass (4/4)
  • Fitnet.Contracts (7 projects)
  • Fitnet (13 projects)

Note: Fitnet.Contracts and Fitnet depend on published NuGet packages from Fitnet.Common. Full build verification requires updated packages in GitHub Package Registry.

📦 PR Includes

  • Bug fix 🐛
  • Code refactor 🔄
  • Documentation update 📚

🚫 PR Does Not Include

  • Breaking changes ❌
  • Major architectural changes 🏗️
  • Unrelated features/tasks 🚫

💡 Additional Notes

All changes follow the .NET 10 upgrade pattern established in PR #228 for Chapter 1. The WithOpenApi() deprecation is framework-wide in .NET 10, requiring the use of separate WithSummary() and WithDescription() methods for OpenAPI metadata.

The NU1510 error fix addresses a .NET 10 behavior change where package references that are already included in framework references are now treated as errors when TreatWarningsAsErrors is enabled.

The IDE0055 formatting fixes ensure compliance with the project's .editorconfig rules (csharp_using_directive_placement = inside_namespace) by properly formatting migration files with appropriate spacing and required using statements.

The CS1587 error fix ensures XML documentation comments are properly placed before attributes, following C# language rules.

Original prompt

Upgrade Chapter 3 to .NET 10


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Upgrade Chapter 3 to .NET 10 Upgrade Chapter 3 to .NET 10 Dec 12, 2025
Copilot AI requested a review from kamilbaczek December 12, 2025 20:44
@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot fix all build and test issues like #228

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot fix all build and test issues like #228

Fixed in commit 843911b. Updated all 4 Chapter 3 workflow files to use .NET 10.0.x:

  • chapter-3-workflow.yml
  • chapter-3-contracts-workflow.yml
  • chapter-3-package-workflow.yml
  • chapter-3-contracts-package-workflow.yml

Build and tests verified for Fitnet.Common (4/4 tests passing).

Copilot AI and others added 2 commits January 24, 2026 10:12
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
@kamilbaczek kamilbaczek force-pushed the copilot/upgrade-chapter-3-to-dotnet-10 branch from 843911b to 3b50eb7 Compare January 24, 2026 09:12
@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot fix error /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj : error NU1510: Warning As Error: PackageReference Microsoft.AspNetCore.Http.Abstractions will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.slnx]

…ence

Fixes NU1510 error in Fitnet.Contracts.Infrastructure project. The package is already included via FrameworkReference to Microsoft.AspNetCore.App.

Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot fix error /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fi...

Fixed in commit 612b70b. Removed the redundant Microsoft.AspNetCore.Http.Abstractions package reference from Fitnet.Contracts.Infrastructure.csproj. The package is already included via FrameworkReference to Microsoft.AspNetCore.App, which caused the NU1510 error in .NET 10.

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot fix Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrast

Copilot AI and others added 2 commits January 24, 2026 09:38
Add missing blank line between namespace declaration and using statements in three migration files to comply with C# formatting rules.

Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Add using System.Diagnostics.CodeAnalysis to migration files that use [ExcludeFromCodeCoverage] attribute.

Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot fix Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/...

Fixed in commits 213c187 and ef88f80.

Added missing blank line between namespace declaration and using statements, and added the missing using System.Diagnostics.CodeAnalysis; statement for the [ExcludeFromCodeCoverage] attribute in three migration files:

  • 20230601184153_MakeSignedAtColumnNullable.cs
  • 20230601184328_AddCustomerIdColumn.cs
  • 20230624171216_ContractsAddColumnsToSupportContractExpiration.cs

@kamilbaczek kamilbaczek marked this pull request as ready for review January 24, 2026 10:56
@kamilbaczek
Copy link
Copy Markdown
Collaborator

Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20250927073029_AddMissingForeignKeys.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj]
Fitnet.Reports -> /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Reports/Fitnet.Reports/bin/Debug/net10.0/EvolutionaryArchitecture.Fitnet.Reports.dll
Fitnet.Passes.IntegrationEvents -> /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/bin/Debug/net10.0/EvolutionaryArchitecture.Fitnet.Passes.IntegrationEvents.dll

Build FAILED.

Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20250927073029_AddMissingForeignKeys.cs(4,1): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj]
0 Warning(s)
3 Error(s)

fix @copilot 

Add missing blank lines between namespace declarations and using statements, and add missing using System.Diagnostics.CodeAnalysis for ExcludeFromCodeCoverage attribute in three migration files.

Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/2023...

Fixed in commit 982bc39.

Added missing blank lines between namespace declarations and using statements, and added the missing using System.Diagnostics.CodeAnalysis; statement for the [ExcludeFromCodeCoverage] attribute in three migration files:

  • 20230503180337_CreateOffersTable.cs
  • 20230503180338_CreatePassesTable.cs
  • 20250927073029_AddMissingForeignKeys.cs

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20250927073029_AddMissingForeignKeys.cs(9,1): error CS1587: XML comment is not placed on a valid language element [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj]

XML comment must be placed directly before the class declaration or before attributes. Moved /// <inheritdoc /> comment before [ExcludeFromCodeCoverage] attribute.

Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrat...

Fixed in commit 1cd1aff.

Moved the XML comment /// <inheritdoc /> before the [ExcludeFromCodeCoverage] attribute. In C#, XML documentation comments must be placed before all attributes on a class declaration.

@kamilbaczek kamilbaczek enabled auto-merge (squash) January 24, 2026 14:37
@kamilbaczek kamilbaczek disabled auto-merge January 24, 2026 14:38
@kamilbaczek kamilbaczek merged commit 3a211e6 into main Jan 24, 2026
7 checks passed
@kamilbaczek kamilbaczek deleted the copilot/upgrade-chapter-3-to-dotnet-10 branch January 24, 2026 14:38
kamilbaczek pushed a commit that referenced this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants