Archive

There was some high-coverage bug so I had to refresh CTP 2. You have to download it again if you already did it. -gael

I am pleased to announce I have just released PostSharp 1.5 CTP 2 with exciting improvements over PostSharp 1.5 CTP 1 and of course PostSharp 1.0. Among the things you can be looking forward:

  • Aspect Inheritance. This is something many of you have longed for. You can now apply an aspect on a (non-sealed) class or a (non-sealed) virtual method and have the aspect automatically applied to all derived classes or methods. The same with interfaces. Since the feature is implemented at the level of MulticastAttibute. I will blog further about this feature in a next post, but if you are eager to try, everything is hidden behind the MulticastAttribute.AttributeInheritance and MulticastAttributeUsage.Inheritance properties!
  • Pluggable Aspect Serializers. If you cannot use the BinaryFormatter to serialize Laos aspects, you can now override the serializer implementation. You can even use no serializer at all and have the aspects constructed at runtime by ad-hoc MSIL instructions. And why would you need to do it? For instance for compatibility with code obfuscators (breaking the relationship between serialization and code), because of an extra need of speed or you need...
  • Support for Partial Trust: Since PostSharp Laos is not bound to the BinaryFormatter any more, you can now use assemblies transformed by PostSharp in partially-trusted scenarios. And this may become more important that you now imagine!
  • Built-in support for ASP.NET: It used to be available as a separate project; it is now merged in the principal trunk and will be fully supported.
  • Injection of Custom Attributes: This new aspect allows you to add custom attributes to any element (type, method, field, method, property, event, parameter, return value, assembly) from a CompoundAspect. See CustomAttributeInjectorAspect for details.
  • All the bug fixes up to PostSharp 1.0 SP 1.
  • The field injected by a CompositionAspect can be marked as non-serializable.

New features are not yet documented in the user guide (yet they are in the class reference); I will blog about them more in detail during next days.

Happy PostSharping!

-gael

It is not a release, because I would need the bravest of you to test it (oh, come on, I tested it extensively in lab conditions!), but it's another significant step forward: PostSharp 1.0 SP1 is nearly ready. The complete list of fixed issues is on our issue tracker. Half a dozen of bugs have been reported by the community, all of minor impact, which means that 1.0 RTM was already very stable. Here is the list of the most visible improvements:
  • Runtime performance improvements: Many of you have complained (yes) of poor runtime performance and I have to admin that they were right to a certain extend. A service pack was surely not the place to make great improvements, but I have found some points where little effort resulted in high effect:
    • OnMethodBoundaryAspect do not call "methodof" at each method invocation; this information is cached instead. That is, only if neither the method neither the type is generic! Alex Yakutin (dataobjects.net) measured that the call of "methodof" was the most important performance killer. It has been removed.
    • The same with OnFieldAccessAccess and "fieldof".
    • OnMethodInvocationAspect has now its own and optimal implementation of DynamicInvoke. Microsoft's implementation was shamefully slow since it all relied on reflection. PostSharp now emits optimal MSIL instruction so there is no reflection at all!
  • Side-by-side compatibility with the future PostSharp 1.5 CTP 2 due in a few days.
  • Breaking change: All PostSharp assemblies have now and will have version 1.0.0.0 (i.e. the build and revision numbers are always zero) and you need to require a specific version in Visual Studio. This was due to the SxS challenge with 1.5. It also means that you won't need to recompile plug-ins for each reversion of PostSharp; it will be enough to do it for each minor version.
  • Some annoying problem with debugging experience has been fixed: sometimes the debugging cursor did not really follow the actual code!
  • Some less visible issues you can see in our issue tracker.
I repeat, this is not the SP1 yet, this is a pre-release. I need a hundred of you to try it and to report bugs (eventually), then I will promote it to the SP1 release and update the download page. And now, what everyone expects, the download link. Which one? Oh, there is none, sorry. You have to download revision 459 or higher from http://download.postsharp.org/builds/1.0/. Happy PostSharping! -gael