Why would you want to add another tool in the already-complex development environment of your team? The ultimate reason is: it will reduce development and maintenance cost of your applications. Let's see how.

Less of Lines of Code

Every line of code is a source of complexity and a potential source of problem. Every line of code costs money. Therefore, every line of code that does not contribute directly to the core concern of the program should be considered with great attention.

Non-functional requirements like transaction management, tracing, security, and exception handling, rarely add business value to the program. They are nevertheless important, since unreliable programs are of no business value at all.

As they are typically implemented by the repetition of the same pattern for the dozens and dozens of methods to which they apply, non-functional requirements generally result in numerous lines of codes.

With aspect-oriented programming, you can address non-functional requirements declaratively and simply remove these bad and expensive lines from your code.

Better Design

The problem with non-functional requirements is that their implementation is mangled in all methods implementing functional requirements. This severely violates the established principle of separation of concerns. With aspect-oriented programming, you could:

  • Improve feature localization: the implementation of transaction handling will be located in the transaction handling aspect, not in every business method.
  • Reduce component coupling: business code will not be directly coupled to the transaction handling implementation any more; it will be easier to change the transaction handler for another.
  • Improve skill set consistency in your team: a domain expert will not have to care about how to implement properly caching in a multithreaded context any more; he will just declare the business method cacheable.

Automate Pattern Implementation

Implementation Patterns are best practices learned by the community through experience. Patterns are often formalized in natural language as 'recipes' giving a solution to a given problem.

Aspect-oriented programming (AOP) makes it possible to encapsulate some of the best practices into executable code: instead of suggesting how to implement correctly exception handling, you may make a custom attribute out of it, and let it available to the team.


About PostSharp

PostSharp is an free, open-source and extensible platform for enhancement of .NET assemblies, that is: PostSharp transforms assemblies after compilation.

Pretty abstract, isn't it? Not so much. It has great applications. PostSharp Laos, a Lightweight Aspect-Oriented Solution, provides aspect-oriented programming (AOP) to .NET Developers without the learning curve.


Discover the features of PostSharp Laos, a state-of-the-art AOP framework for .NET developers and PostSharp Core, the platform on which it is built.


Benefits of AOP

AOP reduces the number of lines of code and improves logical decoupling of components. It saves effort and money.


User Stories

PostSharp is already being used by commercial companies. Read what they say about PostSharp.


Frequently Asked Questions

A FAQ about licensing, contributions, and project history.


Getting Started

Give PostSharp a try! You can add your first aspect in your software in a matter of minutes.



PostSharp Laos is 'only' a plug-in built on the top of PostSharp Core, an extensible platform for post-compilation processing of assemblies.



Believe it or not, but PostSharp is largely documented. Looking for tutorials, reference documentation, or scientific papers?


Open Source License

PostSharp is released under GPL/LGPL v3, which means that it is free even for most commercial uses. Be sure to read the notice, however!


Home Page

Welcome to PostSharp!

PostSharp is a tool that can reduce the number of lines of code in all major Microsoft .NET languages and improve its logical decoupling. Therefore its helps you delivering higher stability, cleaner design, and cheaper source code maintenance.

Have you already implemented things like transaction management, logging, caching, or security? In each method, you had to write a same dozen of lines of code, right?

Thanks to PostSharp, you can encapsulate these aspects as custom attributes. This is sometimes called aspect-oriented programming (AOP) or policy injection. Look out:

{loadposition inset}

And if you have 5 minutes left, look at this video. If you are already sold, download the software and start killing redundancies in your code today.