PostSharp is a development tool for C# and VB.NET that enables developers to achieve more with less code. Write clean, stable, efficient and concise code that needs less development time, produces fewer bugs and is easier to maintain. Deliver better separation of concerns, reduced code scattering, code tangling and coupling via partially or fully executable design patterns. PostSharp's Aspect Framework enables you to build and inject custom design patterns into your .NET apps.
Key Features and Capabilities
Features will vary depending on the edition that you purchase.
Core Aspect Framework
Advanced Aspect Framework
- Exception handling
- Method interception
- Method decorator
- Property and field interception
- Build-time validation
- Attribute multicasting.
Diagnostics Pattern Library
- Intercept events
- Introduce methods, events, properties, interfaces
- Add custom attributes, managed resources
- Apply aspects using multicast custom attributes
- Apply aspects using multicast XML file and dynamic provider
- Robustly compose aspects.
Visual Studio integration
- Detailed tracing - add logging to your codebase and keep it in sync, automatically, with support for NLog, Log4Net, and Enterprise Library.
Enforce good design
- Code editor enhancements - see which aspects are applied to the code you're editing thanks to code adornments and enhanced tooltips
- Aspect browser - see all aspects present in your solution and which declarations have been affected
- File and line number of error messages.
Model pattern library
- Extended Reflection API - get what System.Reflection does not give to you: programmatically browse used-using, parent-child, or member-type relationships at high speed using PostSharp's internal indexes.
- Syntax Tree Decompiler - decompile methods to Abstract Syntax Trees and perform finer analysis.
- Built-In Architecture Constraints - have a finer control over visibility of types and members.
- Custom Architecture Constraints - enforce your own design rules.
Threading pattern library
- INotifyPropertyChanged - Implement the right property change notifications at the right time, automatically.
- Code Contracts - Add precondition checking to your codebase using custom attributes.
More information on pattern libraries
PostSharp Model Pattern Library
- Thread dispatching - simplify dispatching execution back and forth between background and foreground threads
- Exclusive threading model - prohibit multiple threads from concurrently accessing an object. Throws an exception instead of allowing data corruption
- Reader/writer synchronised threading model - safely share objects between several threads and declare lock level semantically, using custom attributes
- Actor threading model - use Erlang-like actor-based multithreading in C# 5.0
- Deadlock detection - simplify the diagnosis of deadlocks in your project and never allow your application to freeze without an error message.
PostSharp Model Pattern Library provides automation for the most ubiquitous design patterns - the ones typically used in Model or View-Model layers of modern apps.
The implementation of INotifyPropertyChanged does not stop at the obvious. It also analyses chains of dependencies between properties, methods and fields in your source code, and understands that property getters can access several fields and call different methods, or even depend on properties of other objects.
You will never forget to raise a property change notification again!
PostSharp Diagnostics Pattern Library
We've all been there. Sometimes things go wrong in production and you can't reproduce the issue on your machine. At such moments, you wish you could have a detailed trace of your app execution, including arguments and return values. But who has time to add detailed logging to thousands of methods?
This is exactly why PostSharp created the Diagnostics Pattern Library. With just a few clicks you can add tracing to your entire application or to selected parts of it, without a single line of code. PostSharp supports most popular back-ends, including NLog, Log4Net and Enterprise Library, and you can easily switch between them. And because PostSharp takes care of performance, runtime configurability and re-entrance, you can focus on business value.
PostSharp Threading Pattern Library
During the early days of computing, programmers were so busy managing memory and CPU registers they could barely focus on business features. Generations of compilers raised the level of abstraction so well that, today, memory management is no longer a preoccupation. Now, you can repeat this success story with multithreading.
Instead of using locks and other low-level synchronization mechanisms, you can work at a more conceptual level, follow design patterns that are known to work, and rely on the compiler to generate low-level code and validate design rules. There's no need to switch to another language. With the Threading Pattern Library, you can follow multithreading best practices in C# or Visual Basic apps.
Dependent on the edition - please see edition tab for more information.
- Unlimited number of build servers
- Perpetual license
- Includes 1 year of support and updates
- Code Contracts
- Aspect Framework
- Architecture Framework
- Dependency Property
- Aggregatable (parent/child/visitor)
- Thread Affine
- Reader-writer synchronised
- Deadlock detection
- Thread dispatching
- Custom License Agreement
- License Server
- Source Code Blueprint Subscription