Archive for .NET
Reworking the Gibraltar AddIn API
Posted by: | Comments
There’s a classic saying in designing software that you should plan on throwing the first one away. I’ve never been very comfortable with that because it can be easily abused by a team to justify half-baked thinking, inadequate requirements and design, and just general hope instead of solid engineering.
That said, it’s generally been my experience that no matter how good and diligent you are when designing an API you’ll inevitably find that you’ve missed the mark as soon as the first set of users start solving real problems with it. So, you’ll want to leave room to redo and rethink your original approach before you’re married to it. This is the major reason that we shipped Gibraltar 2.2.0 as a Beta back in early April with our first vision of a Gibraltar Add In API.
Feedback from inside & outside
To make sure we got solid evidence that the design was sound we worked hard to get some existing customers as well as outsiders to try solving their challenges with the API. We also did our own internal Red Team approach: we asked Jay (who isn’t doing any day-to-day development on Gibraltar, but has extensive commercial development experience) to scratch his favorite itch with the API as well. We’re going to publish more about what he built soon, but without going into details something significant emerged from his work and discussions with our customers.
Instead of people using the API to solve a few tactical problems (like data export or an alternate view of the data) people wanted to use it to extensively integrate Gibraltar with external systems. This went way beyond our original intent; we have a big block of features on our roadmap for creating an external integration engine and hadn’t ever intended this to be the way that came about. Despite that, it’s the problem people kept wanting to solve with the API.
Unfortunately, there are several things that we just didn’t allow for, but are common problems in these scenarios:
- Configuration Management: Whenever you’re working between two systems, you’ll want some metadata to describe endpoints and map data between the systems.
- Credential Management: Nobody likes hardcoding credentials, or doing something simple like popping them in a file without encryption. We all know the right things to do, but it’s annoying and overhead. It should be built in.
- Coordination: All the various user interface and process extensions don’t exist in a vacuum; they need easy ways to coordinate their work to enable new processes, not just isolated features.
- More Extensibility: People want to be able to extend other parts of the UI again with the goal of connecting processes together.
- Development Debugging: In a twist of irony, it’s hard to log and view data from within an Add in because you’re running within the Gibraltar environment; you can’t use the Agent to log because you’re running inside of the Agent. This made development of extensions a pain.
Powerful capabilities, not demoware
As we’ve said before, we hate demoware. Although we’ve heard from a few parties that we just need to “check the feature box” with the API (have it but no one will use it), we just aren’t willing to accept that measure for success. Instead, we see another angle: We’re going to leverage the add in API ourself to enable us to create targeted features that only apply to some part of our audience so we can create them faster and keep control over the product’s complexity. In short, we’ll make sure that it’ll solve problems for you by having it solve problems for us.
Fortunately, we didn’t have to throw the first one away in a literal sense. We did end up discarding virtually our entire implementation of it from the Gibraltar side, but the change to the API you see is fairly modest.
We’re still finalizing the details, and deciding whether we need to do another beta round of 2.2 or should go ahead and formally release 2.2 so that everyone can get the benefit of all of the improvements that have happened over the past several months beyond the API. But, we can speak to a few great features:
Configuration Management
Configuration data can be shared between the Hub and all of its connected Analysts. This makes it more practical for add ins that connect systems together but need everyone on the team to share metadata on how items in both systems relate. Since add ins can run on both the Hub and in the Analyst we made it so you can change the Hub configuration for an add in remotely. This means you don’t have to run to IT and get on the server to say add new mappings for new projects or do whatever other configuration your favorite add in requires. The central data is automatically synchronized between the Hub and Analyst and is available even if the Hub isn’t (say because you’re running disconnected from the network)
For example, say you want to integrate with your defect tracking system. It’ll have some form of heirarchy for managing things – probably with different areas for the current development release vs. the production releases, etc. You need to be able to relate the data Gibraltar has (like product and application names as well as versions) to those areas so when it opens or updates an issue it shows up in the right place and in the right workflow.
Credential Management
In a perfect world, your Windows credentials would give you access to any external system your Add In needs to access, so no credentials need to be stored. Unfortunately, most of the third party systems you’ll want to integrate with (particularly ones that aren’t designed for enterprises) just flat won’t integrate that way. You need to be able to store a user id and password but do so in a way that doesn’t create an unreasonable security risk.
We’ve baked in credential management leveraging the data protection API in Windows (DPAPI) so that you can encrypt account names and passwords so they can be accessed only by the current user, computer, or the hub. Here again you can manage it all from Analyst, so if you need to change the account the Hub is using to login into your defect tracking system or something you don’t have to go to the server to do it.
Development Debugging
We’re taking advantage of improvements in the Live Log Viewer control to offer a real-time view of what’s happening with Add Ins, both the Gibraltar side and the messages logged by each Add In. We log a lot of information as Analyst runs, and we don’t want to bury you in all of that detail so it automatically filters down to just information needed to monitor and support Add Ins.
This is done using only capabilities that are exposed through our normal API, so you can do the same thing in your WinForms/WPF application as well. You’ll notice we’ve updated the live viewer to include a number of capabilities formerly only available in Analyst, like source code lookup and exception / detail viewing.
More Extensibility
We’ve added a number of places you can extend Gibraltar to the original list:
- Analyze Sessions on Hub: Any analysis engine you create can run in Analyst or Hub. We always intended it, but it wasn’t ready for the beta. This means you can have data flowing from Gibraltar to external systems without anyone being logged in or having to leave something running.
- Global Commands: You can extend the main Analyst menu bar with your own menu items to create global commands end users can easily access.
- Controllers: We’ve added some key controller interfaces so you can hold state in the right places (think MVC) and substantially improve the efficiency of integrating with remote systems that may be expensive to query.
- And More: Frankly, we’re going to continue adding items as we head towards release based on our internal experimentation of what we can safely get done and commit to. Our ultimate goal is that you can extend each of the different views in Analyst so you can have it seamlessly participate in end-user workflow.
Real World Experience
We’ve been internally using the new API to help us automate our CEIP process for Gibraltar itself and it’s given us a lot of confidence not just in the new implementation but also in the vision it represents. We’re going to be able to ship extensions outside of our release cycle, add optional modules in the box for a great initial experience, and help create a space for you to show your peers the cool things you can do where Gibraltar + Your System = Awesome.
Is there a specific system you’d like to see us integrate with? Drop us a line; we love to engage with our peers to understand new & creative ways to make a difference in how developers create rock solid .NET software.
Using Gibraltar, PostSharp and Visual Studio 2010
Posted by: | CommentsEditors 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.
.NET 4.0 Client Profile and the Power of Defaults
Posted by: | CommentsNote: The issues raised in this post were addressed in Gibraltar 2.5 which was modified to be fully compatible with the .NET 4 Client Profile.
The good news
The Gibraltar Agent works just great with .NET 4.0. We support the same application environments we support for older versions: WinForms, WPF, Services, and ASP.NET. If you’re looking for Silverlight support, drop us a line – we are working in that direction and would like to hear about your project to see how it fits into our roadmap.
So, if you want to leap forward to VS 2010 the very instant you can download it from MSDN, don’t let us stop you – you can use Gibraltar just like before.
And the not-so-good news
We were doing some broader testing with Visual Studio 2010 RC and ran into the same issue as one of our component vendors, DevExpress: Their CTO covered it well in his article on .NET 4 Client Profile: the Good news and the Bad news. The bottom line problem is this:
- By default, VS 2010 creates new Windows projects with the .NET 4 Client Profile.
- The .NET 4 profiles split up the .NET runtime libraries by application type instead of technology, so the Client Profile doesn’t include any of the System.Web classes that have shipped in the core library since .NET 1.0.
What this means is that if you create a new WinForms .NET application in 2010, then add the Gibraltar Agent to it you can’t load it or use it because internally we reference the System.Web namespace. A user will believe we’re just flat broken right out of the box.
Fortunately, as long as you change the default target (which Visual Studio will prompt you for in a compiler warning) then the Gibraltar Agent works. It’d be nice if that warning was an error – since you get other errors which will lead you in the wrong direction:
It’s easy to miss warnings when you’ve got errors…
Because of this we’re going to have to refactor some of the internals of the Agent and align the agent into separate libraries by .NET 4 Profile. This is unfortunate because we’ve worked hard to have the smallest number of assemblies (usually you just need one) and this is going to create more complexity for our users. These changes will wait for Gibraltar 3.0 because they would be a breaking change from the standpoint that the changes won’t necessarily let you just drop in the same assemblies and go.
Gibraltar 2.2 Beta 1 Now Available
Posted by: | CommentsThe first beta of Gibraltar 2.2 is now available to download. The big picture items in this release are:
- New add-in integration API: You can do some fun stuff with this, like exporting data to your own data warehouse or integrating with your favorite defect tracker. We’ve provided some samples to get you started and make sure it’s easy.
- System tray and run at login integration: Particularly if you’re using Gibraltar Hub this is a killer feature that you have to experience. It makes integrating Gibraltar into your personal workflow much more fluid.
- View errors without opening sessions: You can preview the errors in a session without having to open it up to decide if it’s worth drilling into. This saves a lot of time when reviewing large numbers of sessions.
- Add metric groups to charts in one step: You can add any number of metrics to a chart at once just by dragging the folder they contain onto the chart. It’ll sort out the compatibility for you in one step. If you’ve been using metrics, particularly using our aspects for PostSharp, this feature will save you a lot of time.
A hidden feature for existing Gibraltar users is that we’ve dramatically reduced the memory used for packaging and sending sessions via email or writing them to files. Basically, we’ve optimized the case where a session isn’t fragmented to never buffer the data in memory resulting in a small and predictable memory footprint even for very large sessions.
Safe for production use
The reason this is considered a Beta release is because of the new Add-In integration API. This affects Analyst only. Otherwise it has passed all of our production tests and is safe to deploy and use broadly. We are likely to make changes to the Add-In API based on your feedback and our own experience for the final release.
We will provide our normal full support for this release at least through shipping the final release of 2.2.
Path to final release
We expect to wrap up the beta of 2.2 and ship the production version in the next 6-8 weeks depending on your feedback. We want to make sure there are several add-ins available on initial release and get in some other exiting capabilities we can’t talk about just yet before we close the books on Gibraltar 2 and move on to our next major release.
This is a great chance to influence the design of a major feature of Gibraltar – play around with creating add-ins and let us know what you think. What are we missing? What type of add-ins do you want to see (perhaps there’s someone else that wants the same thing)? Drop us a line and let us know.
Trial users
We’d encourage you to try out this new release as well, particularly if you think you’ll get more out of the new features we’ve added. All you need to do is register for an account (free and fully automated) and you can get it. Your existing 14 day anonymous trial or 30 day trial key will continue just fine with this beta release.


