Scrutor adds Scan and Decorate extension methods to Microsoft.Extensions.DependencyInjection. Teams use it to register types by convention and wrap existing services.
Overview
Scrutor is a NuGet package that extends the standard .NET dependency injection container with assembly scanning and service decoration. It builds on Microsoft.Extensions.DependencyInjection rather than replacing it.
The Scan entry point configures how assemblies are searched and which classes are registered against which interfaces or as concrete types. Documentation covers filtering compiled view types when UI frameworks generate extra interfaces.
The Decorate method wraps services already in the container, which supports cross-cutting patterns such as logging or caching around existing registrations without rewriting every binding by hand.
Installation is through the Scrutor package via the .NET CLI or Package Manager. Usage is code-first inside application startup where services are configured.
Key features
- Assembly scanning for IServiceCollection
- Service decoration support
- Convention-based registration
- NuGet package distribution
- ASP.NET Core oriented
- Compiler-generated type filters
- Scan and Decorate APIs
Use cases
- Bulk-registering application services
- Decorating existing DI registrations
- Convention-based ASP.NET startup
- UI framework view registration