Upgrading from template v10.x to v11.x
These are template versions, not .NET versions. Template v10.x targets .NET 9. Template v11.x targets .NET 10. See Versions.
If you started your project with version 10.x of the template (for example 10.1.1) and want to incorporate the architectural changes of version 11.0.0, follow this guide. If you’re going on to v12, follow the v11 to v12 guide afterward.
The diff strategy
Since this template serves as a starting point, the most reliable way to upgrade an existing project is to compare freshly generated solutions:
- Generate a v10 solution and a v11 solution that both use your project name (see the diff strategy), for example with
dotnet new install Ardalis.CleanArchitecture.Template::10.1.1and then::11.1.1. - Use a diff tool (Beyond Compare, WinMerge,
git diff --no-index, …) to compare them. - Manually apply the structural and package changes to your existing project.
Key changes in v11.x
1. .NET 10
The target framework moved from net9.0 to net10.0, and EF Core and the Microsoft.Extensions.* packages moved to 10.0.
2. MediatR replaced by Mediator
The most noticeable change is the removal of the MediatR library (due to its licensing changes) in favor of Mediator (Mediator.Abstractions and Mediator.SourceGenerator), a source-generated implementation.
- Action required: review how
ICommand,IQuery, and their handlers (ICommandHandler,IQueryHandler) are defined in the new template, and update your use case handlers to match. Mediator handlers returnValueTask<T>fromHandle. - Registration moved to
Web/Configurations/MediatorConfig.cs, which lists the assemblies to scan and the pipeline behaviors (such asLoggingBehavior) in order.
3. Strongly typed IDs and value objects with Vogen
ContributorId and ContributorName became Vogen value objects, with EF Core value converters in Infrastructure/Data/Config/VogenEfCoreConverters.cs. The domain also gained a PhoneNumber value object and a ContributorNameUpdatedEvent with an email notification handler.
v11 generated integer IDs with a custom VogenIdValueGenerator. v12 replaces it with database-generated IDs; see step 4 of the v11 to v12 guide before you copy it.
4. Domain events dispatched by an EF Core interceptor
Domain events are now dispatched by EventDispatchInterceptor (in Data/EventDispatcherInterceptor.cs), an EF Core SaveChanges interceptor in Infrastructure, after changes are saved.
5. FastEndpoints API layer
The template continues to use FastEndpoints for the API layer (the REPR pattern), moving from 6.x to 7.x.
- Action required: check the
src/Your.ProjectName.Web/Contributorsfolder in the new template to see whether any base class signatures (Endpoint<TRequest, TResponse>) or FluentValidation extensions have shifted.
6. Aspire 13, SQL Server, and Papercut
The Aspire host moved from Aspire 9 to Aspire 13. In v10 it only launched the Web project, which used SQLite. In v11 it also starts a persistent SQL Server container (providing the cleanarchitecture connection string to the Web project) and a Papercut SMTP container. When the Web project runs on its own, Infrastructure now chooses between SQL Server and SQLite. See Running the Application.
7. Email
The older SmtpEmailSender was removed. MimeKitEmailSender (MailKit) is the SMTP implementation, sending to the Papercut container during local development.
8. Functional tests use Testcontainers
Functional tests run against SQL Server in a Testcontainers container instead of a local SQLite file, so Docker is needed to run them. See Building & Testing.
9. Template configuration and packages
Compare the Directory.Packages.props files to see the newly pinned versions for EF Core, Serilog, FastEndpoints, Ardalis.SharedKernel (3.x to 4.x), and the testing packages.
- Action required: update your Central Package Management file accordingly to resolve any vulnerability or compatibility warnings.
Minimal Clean template
The Minimal Clean template (Ardalis.MinimalClean.Template 1.0) was introduced alongside v11. There’s nothing to migrate from; see Choosing a Template.
