Oct 08
2009

Introducing PostSharp 2.0: #4 - Visual Studio Add-In

Posted by: gfraiteur

Tagged in: Untagged 

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

kick it on DotNetKicks.com
Trackback(0)
Comments (5)add comment

Romain Verdier said:

0
Impressive
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!
 
October 08, 2009 | url
Votes: +1

Me said:

0
...
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.
 
October 08, 2009
Votes: +0

bdaniel7 said:

bdaniel7
Download?
Hey, where's the download link? smilies/cheesy.gif
 
October 08, 2009 | url
Votes: +4

Alex Yakunin said:

0
That's simply great!
Subj. smilies/wink.gif
 
October 08, 2009 | url
Votes: +0

Navin said:

0
Good to have a enhanced tool
but how can i use the plug in.. there is no download link
 
October 09, 2009
Votes: +1

Write comment

busy