AspectCore Documentation
July 25, 2026 · View on GitHub
AspectCore is a cross-platform AOP (Aspect-Oriented Programming) framework for .NET 6+, providing dynamic-proxy interception, dependency-injection integration, web application support, data validation, and more.
This is the complete AspectCore documentation. English lives here; the Chinese version is under ../(中文文档见 ../).
Navigation
🚀 Getting Started
Start using AspectCore from scratch.
- Installation — NuGet packages and target frameworks
- Quick Start — your first interceptor in five minutes
- Core Concepts — interceptor, proxy, aspect context and other terms
📖 Guide
Feature documentation for day-to-day development.
- Interceptor Basics — defining interceptors, attribute interceptors, global interceptors
- Interceptor Configuration — the three registration styles and scope predicates
- Async Interception — Task / ValueTask / IAsyncEnumerable
- Conditional Interception — matching by namespace / service / method
- Dependency Injection — the built-in container and Microsoft.Extensions.DependencyInjection
- Third-Party Containers — Autofac / Windsor / LightInject
- Configuration Injection — binding values from IConfiguration
- Data Validation — DataAnnotations validation interception
- Reflection Extensions — AspectCore.Extensions.Reflection high-performance reflection
- Common Scenarios — logging, caching, retry, performance monitoring, and more
🏛 Architecture
Design documents for contributors and advanced users.
- Overview — layering and runtime flows
- Module & Package Design — responsibilities and dependency direction across the 15 packages
- DynamicProxy Runtime Engine — runtime proxying based on Reflection.Emit
- Source Generator Compile-Time Engine — compile-time proxying based on Roslyn
- Engine Comparison & Selection — DynamicProxy vs SourceGenerator vs Auto
- C# Language Feature Adaptation — how C# 6 ~ C# 13 features are adapted in AOP emit
- Record Type Support — the two-engine differences for C# 9 record proxying
🔧 Development
For contributors to this repository.
- Building — restore, compile, target frameworks
- Project Structure — source, tests, samples, benchmarks layout
- Contributing — branching, commits, PR flow
✅ Testing
- Testing Strategy — unit, dual-engine parity, E2E, coverage gates
- Running Tests — how to run and filter tests
About This Documentation
This documentation is generated from a source-code scan and aims to stay consistent with the code. It clearly separates "implemented capabilities" from "design / proposals"; unimplemented content is explicitly marked. The product version is defined in build/version.props.