Project structure

July 25, 2026 · View on GitHub

This document explains the top-level directory layout of the AspectCore repository and the responsibilities of each directory. Package-level responsibility boundaries, public entry points, and dependency directions are not repeated here; for those, see Module and package structure design.

1. Top-level directory overview

DirectoryPurpose
src/The 15 publishable source packages (core + extensions + compile-time engine)
tests/xUnit test projects: unit, dual-engine parity, E2E, reflection, and per-container integration; plus a NativeAOT end-to-end verification project
sample/Runnable sample projects
benchmark/The early BenchmarkDotNet benchmark projects (Core, Reflection)
benchmarks/The new unified benchmark project AspectCore.Benchmarks
docs/This documentation (primarily Chinese; English is under docs/en/)
build/Version, signing, and common package properties (props)
.github/CI workflows and the coverage script

The root also contains the solution and workspace files: AspectCore-Framework.sln, NuGet.config, LICENSE, README.md. Builds are driven through the dotnet CLI (see Local build); there are no Cake/PowerShell build scripts.

2. src/ — source packages

There are 15 packages under src/ (excluding Directory.Build.props). They fall into three roles; the responsibilities and dependency directions of each package are in Module and package structure design.

  • Core: AspectCore.Abstractions, AspectCore.Core, AspectCore.Extensions.Reflection
  • Compile-time engine: AspectCore.SourceGenerator (netstandard2.0, loaded by Roslyn)
  • Extensions and integrations: AspectCore.Extensions.DependencyInjection, AspectCore.Extensions.Autofac, AspectCore.Extensions.Windsor, AspectCore.Extensions.LightInject, AspectCore.Extensions.Hosting, AspectCore.Extensions.AspNetCore, AspectCore.Extensions.Configuration, AspectCore.Extensions.DataValidation, AspectCore.Extensions.DataAnnotations, AspectCore.Extensions.AspectScope, AspectCore.Extensions.CastleCompat (a Castle DynamicProxy compatibility shim for gradual migration to AspectCore)

src/Directory.Build.props enables .NET analyzers for all source projects (advisory, not blocking the build).

3. tests/ — test projects

Each project under tests/ corresponds to a category of test target; for test categories and coverage thresholds, see Testing strategy.

Test projectWhat it covers
AspectCore.Core.TestsCore unit tests. Includes the EngineParity/ subdirectory, which verifies that the DynamicProxy and Source Generator engines behave consistently (e.g. RefReturnParityTests, InitRequiredMembersParityTests, record types, etc.); it also has subdirectories such as DynamicProxy/, DependencyInjection/, Injector/, Configuration/, Integrate/, Issues/, Extensions/, Utils/
AspectCore.E2E.TestsEnd-to-end scenario tests, with cases concentrated in Scenarios/ and shared support in Fixtures/ (TestHost.cs, TestServices.cs)
AspectCore.Extensions.Reflection.TestReflection-extension tests
AspectCore.Extensions.Autofac.Test, AspectCore.Extensions.Windsor.Test, AspectCore.Extensions.LightInject.Test, AspectCore.Extensions.Hosting.Tests, AspectCore.Extensions.DependencyInjection.Test, AspectCore.Extensions.Configuration.TestsIntegration tests for each container / host / configuration
AspectCore.Extensions.CastleCompat.TestsMigration-compatibility tests for the Castle DynamicProxy compatibility shim (xUnit)
AspectCore.NativeAot.E2ENativeAOT end-to-end verification project (an executable with OutputType=Exe, PublishAot=true, not an xUnit test), verifying Source Generator interception behavior in a native binary

tests/Directory.Build.props uniformly brings in coverlet.msbuild coverage collection for all test projects.

4. sample/ — samples

Runnable demo projects that showcase typical usage:

  • AspectCore.Extensions.DependencyInjection.ConsoleSample
  • AspectCore.Extensions.Autofac.Sample
  • AspectCore.Extensions.DataAnnotations.Sample
  • AspectCore.Extensions.AspectScope.Sample

5. benchmark/ and benchmarks/

The repository has two benchmark directories:

  • benchmark/ — the early benchmarks: AspectCore.Core.Benchmark, AspectCore.Extensions.Reflection.Benchmark
  • benchmarks/ — the new unified benchmark project AspectCore.Benchmarks

6. build/ — build configuration

Centralized management of version, signing, and common package properties: version.props (product version 3.0.0-rc.1), common.props (package metadata + LangVersion=13.0), sign.props + aspectcore.snk (strong-name signing). Builds are driven directly by the dotnet CLI, reusing these props; there is no Cake script. For details, see Local build.

7. .github/ — CI

  • workflows/build-ci.yml — build, packaging, and MyGet publishing on push to master
  • workflows/build-pr-ci.yml — PR validation: lint, build-and-test (ubuntu/windows), unit and E2E execution and coverage gates, CodeQL
  • workflows/release.yml — the release process
  • scripts/check-coverage.sh — the coverage collection and threshold-assertion script

For CI details, see Testing strategy and Contributing guide.