I’m delighted to announce the release of PostSharp 2.1 RTM, available for download on our web site and on NuGet.

The last release candidate has been available as the front-page download for more than a month now with no reported bugs. PostSharp 2.1 becomes the recommended version for everyone and is now considered more stable than the 2.0 branch.

New features

PostSharp 2.1 brings the following improvements to PostSharp 2.0:

  • Improved build-time performance: up to 5x faster. Read more.
  • Architecture validation: build-time validation of design rules. Read more.
  • Extended reflection API: programmatically navigate code references. Read more and more.
  • NuGet packaging and improved no-setup deployment experience. Read more.
  • Support for obfuscators: we now support Dotfuscator. Read more.
  • Improved Visual Studio Extension (PostSharp tab page in project properties).
  • Warnings and errors now come with file/line information. The feature is optional and must be enabled manually from Visual Studio options. We’re eager to hear feedback about this feature from customers with larger projects.
  • Support for Silverlight 5 and Windows Phone 7.1.
  • Compatibility with Code Contracts 4.
  • Improved messaging API.
  • Streamlined licensing experience and “getting started”.
  • License server (optional).
  • Streamlined “getting started” experience.
  • Warnings can be disabled locally (for a specific element of code) using the IgnoreWarning custom attribute. See online documentation for details.

Bug fixes

The RTM fixes the following issues from RC2:

  • "EnhancedByPostSharpAttribute" causes issues with the WPF compiler
  • Aspected methods with parameter of generic types are not underlined in VS code editor
  • Constant SkipPostSharp does not work
  • Different versions of PostSharp cannot be used in the same solution
  • Error due to file lock of *.vhost.exe
  • Invalid version number is written in native resources
  • MSBuild error "CodeContractsPerformCodeAnalysis target is missing" with Code Contracts Standard (without Code Analysis)
  • Type parser throws exception with arrays or generic types

Upgrading from PostSharp 2.0

This new version is fully backward compatible with PostSharp 2.0 (except one breaking bug fix), and can be installed side-by-side with PostSharp 2.0. In order to upgrade, you should just update the references to PostSharp.dll (and possibly to PostSharp.targets, if PostSharp is installed in source control). A utility contained in PostSharp HQ helps you converting projects from 2.0 to 2.1.

The upgrade is free for everyone and your 2.0 license key will work with 2.1. However, you will be asked to enter your license key.

Even if you are happy with the features of 2.0, you have to upgrade to 2.1 because your projects are going to compile damn faster! Frankly. PostSharp has now the fastest MSIL engine on the market.

Announcing PostSharp 2.0 Update 6

By the way, we’ve also updated the PostSharp 2.0 release. It contains the following fixes compared to the previous update. Needless to say, these fixes are also included in the 2.1 release.

  • Aspect instance fields should not be marked as serializable
  • Aspects may conflict with themselves
  • Attempt to use two adornment layers when symbol file is updated
  • BaseMarkerManager.RefreshTextMarkers causes AccessViolationException
  • Collapsed region names should not be underlined by the VSX
  • CSharpLanguageAdapter.VisitPropertyAccessor causes CodeProperty.get_Parent to throw InvalidOperationException
  • Exception in MulticastAtributeTask when a parameter-level MulticastAttribute is applied to a property
  • Exception in MulticastAttributeTask with inheritance on generic methods
  • Exception when an aspect is applied to a generic protected method, or a protected method of a generic type, in a third assembly.
  • Exception when an aspect is applied to a virtual method of a sealed/value type
  • Exception with multicasting inheritance on generic methods.
  • ImportMember throws an exception when a member is a property and an accessor is missing.
  • In IntroduceMember, CopyCustomAttribute with merge does not work
  • Incompatibility of the PostSharp VSX with CodeRush - collapsed regions
  • Invalid code generation when several OnMethodBoundary aspects are applied
  • Invalid code generation with a MSIL-serialized aspect containing an array argument
  • Invalid handling of generic instances in reflection wrappers
  • Invalid MSIL generation when [IntroduceMember] is applied to a member with a generic type argument
  • InvalidCastException when IAspectProvider is used when MsilAspectSerializer, and a non-instrinsic is passed to the ObjectConstruction
  • InvalidComObjectException from SolutionWatcher constructor
  • ManagedDotNet40Platform.GetGetClrIdentityManagerProc throws COMException: The handle is invalid.
  • Many features MethodRefDeclaration fail when the method refers to an implicit method of multidimensional arrays
  • Method-level MulticastAttributes with multicast inheritance are not multicast to derived types accross assemblies
  • MSBuild step "PostSharp20CopyOutputToCodeAnalysis" can fail because of file locking
  • Multicast attributes are applied to anonymous methods, but should not
  • MulticastAttribute.TargetMemberAttributes is not respected for properties and events
  • NullReferenceException in QuickInfoTracker.OnMouseMove
  • ProjectWatcher.UpdateSymbolPath throws NullReferenceException
  • Some debugging sequence points are dropped
  • ToolInvocationHelper.InvokeTool process output listener causes ArgumentOutOfRangeException on
  • UpdateCheckUtility.BeginRetrieveMessages throws ThreadStartException
  • UpdateCheckUtility.BeginRetrieveMessages throws ThreadStartException
  • VsPackage.BeginInvoke throws COMException
  • Win32Exception in PostSharp.VisualStudio.HWndDispatcher.BeginInvoke
  • Windows Phone 7 does not support tail calls generated by PostSharp
  • WriteWeavingSymbolsTask.Execute throws UnauthorizedAccessException

What’s Next?

It has been precisely one year since I started working on PostSharp 2.1. Arguably, it took way too much time to get that release out of the door. And here’s why: most of our time was invested in building the company and spreading the work about AOP. Since July, I’ve started research and planning for the next major version of PostSharp and a new product code-named Resonance, which will be to .NET software what magnetic resonance is to human body (detailed and non-invasive imaging). We’ve hired two software developers and, while PostSharp 2.1 was maturing, we started real development on the new “thing”. You’re going to be amazed, I promise.

But today, we’ve become confident that PostSharp 2.1 is ready for production, and it’s a great time for you to upgrade.

Happy PostSharping!


We’re thrilled to finally announce the availability of PostSharp training, worldwide. We’ve assembled an experienced team of trainers and consultants to offer a comprehensive 2 day course that’s designed to bring you up to speed fast on aspect-oriented programming and PostSharp.

The course includes hands-on labs and discussion where you’ll learn how to:

  • create PostSharp aspects; and
  • successfully introduce PostSharp aspects into complex projects.

Upon completion, you’ll be able to apply what you’ve learned to your own applications, and produce cleaner, more efficient, higher quality code than ever before.

Meet our Training & Consulting Partners

Donald Belcham is a senior software developer, independent contractor, and agile development expert who is a strong supporter of fundamental OO patterns and practices. He is co-author of the book, Brownfield Application Development in .NET (Manning Press, 2008), and actively shares his expertise with other technical professionals at user groups, code camps and conferences held throughout the world. Past lectures have covered topics that encompass development practices, quality team leadership, and the intricacies of new and emerging technologies.


Golo Roden works as self-employed trainer and consultant for C#, JavaScript and web development – focusing on code quality and agile methods. In 2011 he launched the Agile Development Framework, a comprehensive approach which combines the successful elements of previous agile methods. He has written more than 100 articles for professional magazines, has given more than 50 talks at international conferences, and wrote a book on C# in 2008. Golo blogs regularly and writes a recurring column on C# specialties for dotnetpro magazine.


Endjin is a collaboration of like-minded people who are imbued with an infectious enthusiasm for solving business problems through the smart application of technology. Their endjin-eers are outstanding individuals who have come together from across the business, creative and technology community having demonstrated a mastery of their craft. Unconstrained by industry vertical, company size or budget; endjin is motivated by solving problems. Their goal is to energize your business whether it is through a 2 hour conversation or 2 years of team effort.

PostSharp Training Agenda

The standard public agenda is composed of the following modules (note: for private training other topics can be introduced after discussion with the trainer):

  • Introduction to AOP
  • Basic aspects
  • Applying aspects to code
  • Interception aspects
  • Aspect composition
  • Composite aspects
  • Deployment and build process integration
  • Targeting different platforms
  • Best practices

We’ve got more exciting training news coming in the weeks ahead and, if you sign-up now to request more information about PostSharp training, we’ll let you in on the exciting news (including an exclusive offer) before we announce it publicly.

Happy PostSharping!


I’m pleased to announce the second release candidate of PostSharp 2.1, available for download today on our web site and on NuGet. The first RC proved to be very stable, so this new version contains only relatively minor bug fixes. This RC also contains all bug fixes from the 2.0 branch.

Here’s the list of bugs that have been fixed in this release:

  • CopyCustomAttributes causes exception when several types are passed to the constructor
  • Fields are not visible by the debugger when a class has been moved to a binding class
  • ImageWriter sets the section virtual size to an invalid value, causing failure in Windows Phone
  • Invalid code generation when introducing a property or event of an open generic type
  • Invalid code generation when introducing a property with a private property setter
  • MainForm.CloseNotificationIcon throws InvalidOperationException after hibernation
  • MSBuild failure when building a project on a FAT system (hard links not supported)
  • PostSharp HQ throws exception when saving a license key for all users
  • Setup program displays maintenance dialog when in silent mode
  • Setup program prompts to uninstall previous version of the VS extension even in silent mode
  • The license registration wizard should not be displayed after a silent installation.
  • Exception in MulticastAtributeTask when a parameter-level MulticastAttribute is applied to a property
  • Unused AssemblyRefs are included in the final assembly
  • MulticastAttribute.TargetMemberAttributes is not respected for properties and events

PostSharp 2.1 is the fastest and most stable version of PostSharp and the upgrade is recommended for any one. To convert your projects, either use NuGet, either open PostSharp HQ and click on convert projects.

We’re now planning for PostSharp 3 and a new, truly disruptive, product that will change the landscape of instrumentation and diagnostic of in-production applications. We are hiring; drop us an email if you’re interested in joining the team.

Happy PostSharping!