-
Notifications
You must be signed in to change notification settings - Fork 0
Migration vers .NET 10 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # Migration vers .NET 10 | ||
|
|
||
| ## Date de migration | ||
| 25 décembre 2024 | ||
|
|
||
| ## Résumé | ||
| Ce document décrit les modifications effectuées pour migrer le projet BrilliantMediator et tous ses projets dépendants de .NET 9 vers .NET 10. | ||
|
|
||
| ## Projets migrés | ||
|
|
||
| Tous les projets suivants ont été migrés de `net9.0` vers `net10.0` : | ||
|
|
||
| ### 1. **BrilliantMediator** (src/BrilliantMediator/BrilliantMediator.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - Microsoft.Extensions.DependencyInjection.Abstractions: `9.0.10` → `10.0.0` | ||
| - Microsoft.Extensions.Hosting.Abstractions: `9.0.10` → `10.0.0` | ||
| - Microsoft.AspNetCore.Http.Abstractions: `2.3.0` (inchangé, pas de version .NET 10 disponible) | ||
|
|
||
| ### 2. **BrilliantMediator.Tests** (tests/BrilliantMediator.Tests/BrilliantMediator.Tests.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - Microsoft.Extensions.DependencyInjection: `9.0.10` → `10.0.0` | ||
| - Autres packages de test inchangés (versions stables) | ||
|
oliver254 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### 3. **ConsoleApp** (samples/ConsoleApp/ConsoleApp.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - Microsoft.Extensions.DependencyInjection: `9.0.10` → `10.0.0` | ||
|
|
||
| ### 4. **EcommerceDDD.Domain** (samples/EcommerceDDD/EcommerceDDD.Domain/EcommerceDDD.Domain.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Aucune dépendance NuGet externe | ||
|
|
||
| ### 5. **EcommerceDDD.Application** (samples/EcommerceDDD/EcommerceDDD.Application/EcommerceDDD.Application.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - Microsoft.Extensions.Logging.Abstractions: `9.0.10` → `10.0.0` | ||
|
|
||
| ### 6. **EcommerceDDD.Infrastructure** (samples/EcommerceDDD/EcommerceDDD.Infrastructure/EcommerceDDD.Infrastructure.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - Microsoft.Extensions.DependencyInjection: `9.0.0` → `10.0.0` | ||
| - Microsoft.Extensions.Logging: `9.0.0` → `10.0.0` | ||
|
|
||
| ### 7. **EcommerceDDD.WebApi** (samples/EcommerceDDD/EcommerceDDD.Api/EcommerceDDD.WebApi.csproj) | ||
| - TargetFramework: `net9.0` → `net10.0` | ||
| - Packages NuGet mis à jour : | ||
| - **Suppression** de `Microsoft.AspNetCore.OpenApi` (incompatibilité avec Swashbuckle) | ||
| - Swashbuckle.AspNetCore: `9.0.6` → `10.1.0` | ||
| - Serilog.AspNetCore: `9.0.0` → `10.0.0` | ||
| - Serilog.Sinks.File: `7.0.0` (inchangé) | ||
|
|
||
| ## Modifications de code | ||
|
|
||
| ### Program.cs (EcommerceDDD.WebApi) | ||
| - **Changement de namespace** : `Microsoft.OpenApi.Models.OpenApiInfo` → `Microsoft.OpenApi.OpenApiInfo` | ||
| - Raison : Le namespace a été simplifié dans Microsoft.OpenApi v3.x | ||
|
|
||
| ```csharp | ||
| // Avant | ||
| options.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo { ... }); | ||
|
|
||
| // Après | ||
| options.SwaggerDoc("v1", new Microsoft.OpenApi.OpenApiInfo { ... }); | ||
|
oliver254 marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
oliver254 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Problèmes rencontrés et solutions | ||
|
|
||
| ### Problème 1 : Incompatibilité Microsoft.AspNetCore.OpenApi | ||
| - **Erreur** : Incompatibilité entre Microsoft.AspNetCore.OpenApi 10.0.0 et Microsoft.OpenApi (versions multiples) | ||
| - **Solution** : Suppression de Microsoft.AspNetCore.OpenApi car Swashbuckle.AspNetCore 10.1.0 le remplace | ||
|
|
||
| ### Problème 2 : Source Generator incompatible | ||
| - **Erreur** : `CS0200: Impossible d'assigner la propriété 'IOpenApiMediaType.Example' -- il est en lecture seule` | ||
| - **Solution** : Suppression complète de Microsoft.AspNetCore.OpenApi et utilisation exclusive de Swashbuckle | ||
|
|
||
| ### Problème 3 : Namespace OpenApiInfo changé | ||
| - **Erreur** : `CS0234: Le nom de type ou d'espace de noms 'Models' n'existe pas` | ||
| - **Solution** : Mise à jour du namespace de `Microsoft.OpenApi.Models` vers `Microsoft.OpenApi` | ||
|
|
||
| ## Vérification | ||
|
|
||
| La build a été testée avec succès après migration : | ||
| ```bash | ||
| dotnet build | ||
| ``` | ||
|
|
||
| Résultat : ✅ **Génération réussie** | ||
|
oliver254 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Packages NuGet - Versions finales | ||
|
|
||
| | Package | Version | | ||
| |---------|---------| | ||
| | Microsoft.Extensions.DependencyInjection | 10.0.0 | | ||
| | Microsoft.Extensions.DependencyInjection.Abstractions | 10.0.0 | | ||
| | Microsoft.Extensions.Hosting.Abstractions | 10.0.0 | | ||
| | Microsoft.Extensions.Logging | 10.0.0 | | ||
| | Microsoft.Extensions.Logging.Abstractions | 10.0.0 | | ||
| | Swashbuckle.AspNetCore | 10.1.0 | | ||
| | Serilog.AspNetCore | 10.0.0 | | ||
| | Serilog.Sinks.File | 7.0.0 | | ||
| | Microsoft.NET.Test.Sdk | 18.0.0 | | ||
| | xunit | 2.9.3 | | ||
| | xunit.runner.visualstudio | 3.1.5 | | ||
| | coverlet.collector | 6.0.4 | | ||
|
|
||
| ## Prochaines étapes | ||
|
|
||
| 1. ✅ Migration complétée | ||
| 2. 🔄 Tests à exécuter pour valider le bon fonctionnement | ||
| 3. 📝 Mise à jour du README.md si nécessaire | ||
| 4. 🚀 Commit et push des changements | ||
|
|
||
| ## Notes importantes | ||
|
|
||
| - ⚠️ **Microsoft.AspNetCore.Http.Abstractions** reste en version 2.3.0 car c'est la dernière version stable disponible | ||
|
oliver254 marked this conversation as resolved.
Outdated
|
||
| - ✅ Tous les projets compilent sans erreur ni avertissement | ||
| - ✅ La structure du code n'a pas été modifiée, seulement les versions des frameworks et packages | ||
|
|
||
| ## Commandes Git | ||
|
|
||
| ```bash | ||
| # Vérifier les changements | ||
| git status | ||
|
|
||
| # Ajouter tous les fichiers modifiés | ||
| git add . | ||
|
|
||
| # Créer un commit | ||
| git commit -m "Migration vers .NET 10 - Mise à jour de tous les projets et packages NuGet" | ||
|
|
||
| # Pousser sur la branche | ||
| git push origin migrate-dotnet10 | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |||||
| builder.Services.AddEndpointsApiExplorer(); | ||||||
| builder.Services.AddSwaggerGen(options => | ||||||
| { | ||||||
| options.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo | ||||||
| options.SwaggerDoc("v1", new Microsoft.OpenApi.OpenApiInfo | ||||||
|
||||||
| options.SwaggerDoc("v1", new Microsoft.OpenApi.OpenApiInfo | |
| options.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo |
Uh oh!
There was an error while loading. Please reload this page.