Archive

So you are sold. You started using aspects in your new project. After many months of development, the project gets larger and larger. You started with rather simple aspects like tracing, but now your code is fully aspect oriented. You have Resharped or DevExpress tool to help you navigate your code. But, still, something is missing: you can't answer the following questions:

  • How do I know to which code elements my aspect has been applied?
  • How do I know which aspects have been applied to my code element?

That's why we developed the PostSharp Add-In for Visual Studio.

The first sign is a subtle difference on the splash screen of your favorite IDE:

Subtle difference in the Visual Studio splash screen.

Then a new item in the View menu:

New item in the View menu.

Click on Aspect Browser and you'l have the answer to your first question. On the top of the new tool window, a list of all aspects used in the current solution; in the bottom pane, a list of code elements to which it has been applied. (Note that this works by reading a file written by PostSharp build components, so you have to build the project to see something).

Visual Studio with the new Aspect Browser

You can double-click on any code element in the tree and Visual Studio will open the corresponding source code file and position the cursor at the proper location.

Now what with the second question? How do you know that a code element has been enhanced by an aspect? Very simply: it is lightly underlined. Move your mouse cursor to that area and a tooltip will show you which aspects exactly have been applied to this element.

Visual Studio with the new Aspect Browser

Look at class Customer. The aspect EntityAspect is inherited from class Entity. How would you know this without the plug-in, just by looking at the code?

And, yes, tooltips are clickable!

Happy PostSharping,

-gael

Comments (7) -

Romain Verdier
Romain Verdier
10/8/2009 12:02:22 PM #

Wow, that's great. PostSharp is already an excellent tool without that, but such an addin can really help people (including Spolsky) to jump into the AOP world. It offers a strong argument against FUD.

Congratulations!

Me
Me
10/8/2009 12:13:00 PM #

I don't need to tell you. You already know you're a genius, and your work is highly appreciated by MANY. PostSharp could soon be, if it already isn't, one of the most important developments in software development.

Thank you, Gael, for your brilliant and hard work.

bdaniel7
bdaniel7
10/8/2009 12:15:09 PM #

Hey, where's the download link? :D

Alex Yakunin
Alex Yakunin
10/8/2009 9:06:02 PM #

Subj. ;)

Navin
Navin
10/9/2009 6:28:56 PM #

but how can i use the plug in.. there is no download link

Hermann
Hermann
2/24/2010 10:08:38 PM #

Wow, this is awesome. I agree with the second poster, PostSharp is one of the most important developments in Software Development.

Candi
Candi
5/16/2010 9:20:52 PM #

The aspect browser works great. I can see all my aspects and the methods they're applied to. It takes me right to the code as described.

2nd part doesn't seem to work at all. My methods aren't underlined and the tool tips aren't available.

Comments are closed