PostSharp
PostSharp is a development tool for the .NET platform that implements aspect-oriented programming (AOP). It enables cross-cutting concerns to be modularized as reusable aspects and inserted into existing code without invasive edits. Unlike runtime proxies, PostSharp uses compile-time or build-time weaving to inject aspect logic directly into the IL of assemblies.
Aspects are implemented as classes derived from base aspect types such as OnMethodBoundaryAspect, MethodInterceptionAspect, and LocationInterceptionAspect.
Weaving is performed by a PostSharp weaver during the build process, typically integrated via MSBuild or NuGet.
Common use cases include logging, exception handling, input validation, caching, security, and performance instrumentation. Aspects can
PostSharp is available in a Community Edition (free for open-source and personal use) and several commercial