Wiki

Clone wiki

GoingPostal / Home

#GoingPostal#

First of all, if you have any suggestions or clarifications regarding this documentation, please contact me (registered users) or create an issue (anyone).

GoingPostal is a set of aspects written for PostSharp on the .NET platform. See the full catalogue here.

There are 2 nuget packages available:

Contracts Killer was motivated by the constant need to add parameter checking to methods. All the available alternative methods so far - hand-coding, MS Contracts and even PostSharp's Contracts library - require adding code for every single parameter check. ContractsKiller adds multicasting for parameter checks - a single line of code can add parameter checking to an entire assembly. See NotNullReferenceParameterPolicy and StringParameterPolicy.

GoingPostal The dispose pattern in .NET is often implemented incorrectly or incompletely. PostSharp's implementation mandates the use of their own advisable collections which is more intrusive, incurs a performance penalty and requires more effort to add to existing code. AutoDispose and AutoDisposeDescendent add the complete pattern to existing classes with a single attribute with support for customising the fields to dispose, the order they are disposed in, when to throw ObjectDisposedException and unhooking events.

Please note there is extensive documentation on the PostSharp site covering related topics such as multicasting.

Installation

Add the Nuget package GoingPostal or Contracts Killer to your project.

Configuration

No configuration is necessary. Just add the aspect attributes to your source.

Dependencies

A license for Postsharp Professional or Ultimate is required. Note that this license is only required for developers not for the final deployed product. Due to the lack of aspect inheritance and other features in the Express edition, GoingPostal aspects are not supported and have not been tested with that edition.

Deployment

Simply add the dlls from the nuget packages to your deployment package. No configuration changes are necessary.

Note there are 3 different versions of the DLLs, each supporting a different .NET version = 3.5, 4 and 4.5+. The supported runtime is visible as the suffix to the Assembly Product value in the Explorer's File Properties if there's any confusion.

ECCN

For those projects that require a US Export Control Classification Number, ContractsKiller is self-classified as 5D992, the same as PostSharp itself.

Updated