| name | abp-framework |
| description | ABP Framework v10.x (10.4/10.5) core guide: solution templates (app, app-nolayers, microservice), layered architecture, module system, base classes (ApplicationService/DomainService), Clock/GuidGenerator/CurrentUser/LazyServiceProvider, .NET 10. Use when creating an ABP project, or when architecture or core conventions are needed. |
ABP Framework — Core Skill
Core development skill for ABP Framework v10.x (10.4/10.5). A guide to opinionated, DDD-based, modular ASP.NET Core application development.
Trigger
- "create a project with ABP"
- "ABP solution/template"
- "ABP module"
- "ABP best practices"
- "ABP architecture"
- "abp new"
- working on an ABP project
What Is ABP
ABP is a modular framework built on .NET and ASP.NET Core that offers an opinionated architecture based on DDD principles. It automates repetitive work and provides production-ready startup templates, pre-built application modules, and tooling.
Solution Templates
| Template | Description |
|---|
app | Layered web application (default) |
app-nolayers | Single-layer web application |
microservice | Microservice solution (Business+ license) |
empty | Empty solution |
UI Framework Options
mvc — ASP.NET Core MVC / Razor Pages
angular — Angular SPA
blazor-webapp — Blazor Web App
blazor — Blazor WASM
blazor-server — Blazor Server
react — React SPA (with the modern template)
no-ui — Without a frontend
Database Providers
ef — Entity Framework Core (default)
mongodb — MongoDB
ABP CLI Commands
dotnet tool install -g Volo.Abp.Studio.Cli
abp new Acme.BookStore --template app
abp new Acme.BookStore --template app --modern
abp new Acme.BookStore --template app-nolayers --modern
abp new Acme.BookStore --template microservice --modern
abp new-module Acme.BookStore.Orders -t module:ddd
abp new-module Acme.BookStore.Orders --modern
abp add-package Volo.Abp.EntityFrameworkCore
abp update
abp generate-proxy -t ng
abp generate-proxy -t csharp
abp get-source Volo.Blogging
abp add-source-code Volo.Chat
Modern Templates (--modern flag)
Modern templates are React-first and use a different template source shipped with ABP Studio.
abp new Acme.BookStore --template app --modern
abp new Acme.BookStore --template app-nolayers --modern --modular
abp new Acme.BookStore --template microservice --modern --services Ordering,Shipping
abp new Acme.BookStore --template microservice --modern --shadcn-theme blue
Shadcn theme values: slate (default), pink, blue, turquoise, orange, purple
Project Structure (Layered Template)
Acme.BookStore/
├── src/
│ ├── Acme.BookStore.Domain.Shared # Constants, enums, localization
│ ├── Acme.BookStore.Domain # Entities, aggregates, domain services, repositories (interface)
│ ├── Acme.BookStore.Application.Contracts # DTOs, application service interfaces
│ ├── Acme.BookStore.Application # Application services, object mapping
│ ├── Acme.BookStore.EntityFrameworkCore # DbContext, repository implementations, migrations
│ ├── Acme.BookStore.HttpApi # API controllers
│ ├── Acme.BookStore.HttpApi.Client # Dynamic C# HTTP clients
│ └── Acme.BookStore.Web # MVC/Razor Pages UI
└── test/
├── Acme.BookStore.TestBase
├── Acme.BookStore.Domain.Tests
├── Acme.BookStore.Application.Tests
└── Acme.BookStore.Web.Tests
Module Class Structure
Each module defines a derivative of AbpModule:
[DependsOn(
typeof(AbpAspNetCoreMvcModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(AbpAutofacModule)
)]
public class BookStoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context) { }
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
}
public override void OnApplicationShutdown(ApplicationShutdownContext context) { }
}
Lifecycle Methods
| Method | Description | Async Version |
|---|
PreConfigureServices | Runs before all ConfigureServices | PreConfigureServicesAsync |
ConfigureServices | DI registration and module configuration | ConfigureServicesAsync |
PostConfigureServices | Runs after all ConfigureServices | PostConfigureServicesAsync |
OnPreApplicationInitialization | Before init | OnPreApplicationInitializationAsync |
OnApplicationInitialization | Middleware setup | OnApplicationInitializationAsync |
OnPostApplicationInitialization | After init | OnPostApplicationInitializationAsync |
OnApplicationShutdown | Shutdown logic | OnApplicationShutdownAsync |
Dependency Injection
Automatic Registration Methods
public class TaxCalculator : ITransientDependency { }
public class CacheService : ISingletonDependency { }
public class ScopedService : IScopedDependency { }
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
public class TaxCalculator { }
[ExposeServices(typeof(ITaxCalculator))]
public class TaxCalculator : ICalculator, ITaxCalculator, ITransientDependency { }
[ExposeKeyedService<ITaxCalculator>("taxCalculator")]
public class TaxCalculator : ITransientDependency { }
Manual Registration
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddSingleton<TaxCalculator>(new TaxCalculator(0.18));
context.Services.AddScoped<ITaxCalculator>(sp => sp.GetRequiredService<TaxCalculator>());
context.Services.Replace(ServiceDescriptor.Transient<IConnectionStringResolver, MyResolver>());
}
Base Classes and Pre-injected Services
ABP base classes provide frequently used services ready as properties. Before injecting a service, check whether the base class already has it.
| Base Class | Purpose |
|---|
Entity<TKey> / AggregateRoot<TKey> | Basic entity / DDD aggregate root |
DomainService | Domain business logic |
ApplicationService | Use-case orchestration |
AbpController | REST API controller |
| Property | Available in | Description |
|---|
GuidGenerator | All base classes | Generate sequential GUID (instead of Guid.NewGuid()) |
Clock | All base classes | Current time (instead of DateTime.Now) |
CurrentUser | All base classes | Authenticated user info |
CurrentTenant | All base classes | Multi-tenancy context |
L (StringLocalizer) | ApplicationService, AbpController | Localization |
AuthorizationService | ApplicationService, AbpController | Permission check |
FeatureChecker | ApplicationService, AbpController | Feature check |
LazyServiceProvider | All base classes | Lazy service resolution |
UnitOfWorkManager | ApplicationService, DomainService | UOW management |
Logger | All base classes | Logging |
public class BookAppService : ApplicationService
{
public async Task DoAsync()
{
var now = Clock.Now;
var id = GuidGenerator.Create();
var userId = CurrentUser.Id;
await CheckPolicyAsync("BookStore.Books.Create");
}
}
For non-base-class services, inject the relevant abstraction: IClock, ICurrentUser, IGuidGenerator. For lazy resolution in a base class use LazyServiceProvider.LazyGetRequiredService<T>(); if it is to be injected, ITransientCachedServiceProvider is preferred (IAbpLazyServiceProvider for backward-compat).
Async Convention
- Async all-the-way — do not use
.Result / .Wait() (deadlock risk + untestable).
- Async methods should end with the
Async suffix.
- ABP manages the
CancellationToken automatically in most cases (e.g. HttpContext.RequestAborted); pass it explicitly only for custom cancellation logic.
Time Management (IClock)
Do not use DateTime.Now / DateTime.UtcNow directly. Inject the Clock property (base class) or IClock — for testability and UTC/timezone settings. The Kind (Utc/Local/Unspecified) is configured via AbpClockOptions.
Important Configuration Patterns
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = "...";
});
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = true;
});
Pre-built Application Modules
| Module | Description |
|---|
Volo.Abp.Account | Account management |
Volo.Abp.Identity | Identity & user management |
Volo.Abp.TenantManagement | Tenant management (multi-tenancy) |
Volo.Abp.SettingManagement | Setting management |
Volo.Abp.PermissionManagement | Permission management |
Volo.Abp.FeatureManagement | Feature management |
Volo.Abp.AuditLogging | Audit logging |
Volo.Abp.BackgroundJobs | Background job system |
Volo.Abp.CmsKit | CMS kit (content management) |
Volo.Abp.Saas | SaaS module (PRO) |
Volo.Abp.OpenIddict | OpenIddict integration |
Best Practices
- Always define module dependencies with
AbpModule — use the [DependsOn] attribute
- Use a GUID primary key — generate a sequential GUID with
IGuidGenerator.Create()
- Use DTOs — do not expose entities to the presentation layer
- Use Mapperly — for object-to-object mapping (the default since ABP 10.4)
- Use the repository pattern — inject
IRepository<TEntity, TKey>
- Rely on Unit of Work conventions — no need for manual UOW management
- Prefer async methods — write scalable code with
async/await
- Keep the domain layer isolated from the database provider — use
IAsyncQueryableExecuter
Version Detection & What's New
This skill set covers ABP 10.x (10.4 and 10.5, both on .NET 10). Always detect the solution's actual ABP version before giving version-sensitive advice:
Directory.Packages.props → <PackageVersion Include="Volo.Abp.Core" Version="..." /> (central package management).
*.csproj → <PackageReference Include="Volo.Abp.*" Version="..." />.
common.props / custom AbpVersion MSBuild property.
- No solution present → assume the latest stable (v10.5).
v10.5 (released 2026-06-30) has no breaking changes over v10.4; everything documented for 10.4 also applies to 10.5. New in v10.5 — only recommend these when the detected version is ≥ 10.5:
| Change | Area | Skill |
|---|
S3-compatible blob storage (ServiceURL, DisablePayloadSigning — R2, MinIO, B2, Wasabi, Spaces) | BLOB Storing | abp-infrastructure |
Dynamic background worker capability markers (ISupportsRuntimeRegistration, ISupportsCronScheduling) | Background Workers | abp-infrastructure |
Single-active identity token providers (AbpDefaultTokenProvider, 10-min default lifetime) | Identity | abp-authorization |
OpenIddict default scope fallback (opt-in, AbpOpenIddictAspNetCoreOptions) | Auth | abp-authorization |
MySQL ResourcePermissionGrant index length fix | EF Core | abp-efcore |
| Blazorise 2.2.1, MongoDB.Driver 3.9.0, CodeMirror 6.0.2 | Dependencies | abp-ui, abp-mongodb |
Migration guide: https://abp.io/docs/latest/release-info/migration-guides/abp-10-5
Resources
Related