Using Gibraltar, PostSharp and Visual Studio 2010

Editors Note:  This article has been updated to reflect the release of Gibraltar 2.5 which addresses the issues raised.

While Gibraltar works well with Visual Studio 2010 and .NET 4.0, one place we’ve gotten caught up is with the Gibraltar Agent for PostSharp.   In a nutshell, the current version uses PostSharp 1.5 which isn’t supported (and doesn’t work) with Visual Studio 2010.

To use Visual Studio 2010, you need to update to PostSharp 2.0 CTP5 or later.  This requires a new version of the Gibraltar Agent for PostSharp.  An additional wrinkle is that the .NET Runtime target of an aspect and the application that’s using it must be the same.  This hasn’t been an issue in the past because the .NET runtime was always 2.0 (even if you were using .NET 3.5 because that is just a set of additional libraries on top of .NET 2.0).  With the release of .NET 4.0 this changes and you need to have a version of the aspects that specifically targets .NET 4.0, or you get strange errors.

To add to the complexity, there are two versions of Gibraltar that are “current” today:  2.1.1 which is the current release version, and 2.2.0 Beta 1 which is the current Beta version.  Many people are using 2.2.0 Beta 1, and if you’re new to Gibraltar you should start there.  Because we ship a strongly named binary for our PostSharp aspects it has to match with our Agent version as well.  Taken in total, this would means we need a version for .NET 2.0 and 4.0, Gibraltar 2.1.1 and 2.2.0.

If you’re in this situation where you’re using Visual Studio 2010, or for another reason are running PostSharp 2.0, you’ll need to upgrade to Gibraltar 2.5 or later.  It includes a version that targets PostSharp 1.5 and .NET 2.0 (like before), another for PostSharp 2.0 and .NET 2.0, and another for PostSharp 2.0 and .NET 4.0.  Since the same application could theoretically combine all three they have unique file names to ensure there aren’t any conflicts.   The capabilities of all three are basically the same.

Related Posts

PostSharp Diagnostics Now Supports Loupe in the Box

The latest update to PostSharp Diagnostics adds Loupe support, enabling extensive high-performance logging to be added to any .NET application with virtually no code changes. PostSharp even has a great free option for developers that complements Loupe Desktop! Read more

Loupe Agent for .NET Core Now Available

The first release of the Loupe Agent for .NET Core is also our first open source version of the Loupe Agent. This is the first step in our plan to open source the entire Loupe Agent to make it easier for anyone to extend and take advantage of what Loupe... Read more

We've Moved Loupe Service to App.OnLoupe.Com

Loupe Service now has a shorter, direct site name that's faster, anywhere in the world. Just to go App.OnLoupe.Com, the new CDN-accelerated endpoint for the Loupe Service. Your existing Agents and Loupe Desktops are unaffected by this change, but access to the web UI will be redirected to the new... Read more

Rock solid centralized .NET logging

Unlimited applications, unlimited errors, scalable from solo startup to enterprise.