Scott Hanselman

Reflector 5 Released - World Domination Assured

February 20, '07 Comments [20] Posted in Tools
Sponsored By

UPDATE: Fixed misspelled title, the permalink for this page changed, fix your incoming links!

Reflector 5 is out, and it is good. Go get it immediately, or just run your current version and go Help | Check for Updates.

What's the coolest new feature? Why, a custom "protocol handler" that will soon sweep the (.NET) blogosphere. Select any item in Reflector and press Ctrl-Alt-C to copy the code:// URI for that item. Like this:

Click here if you have Reflector 5 to navigate to this method: code://System.Xml/System.Xml.XmlNameTable/Add

Note that URI can include the version and hash value for the assembly, as my example does in the underlying href.

code://System.Xml:2.0.0.0:b77a5c561934e089/
System.Xml.XmlNameTable/Add(String):String

Worried it won't work in FireFox? Remember that Custom Protocol Handlers aren't an IE only thing. Notice my FireFox dialog below. Just click "Remember my choice" and you'll have the same glorious integrated experience as everyone else. This code:// thing could take off...I wonder if we can work out some kind of cross-promotional thing with the Java guys? ;)

Here's a few ACTION ITEMS for you after you've downloaded the new version:

  • FONT SIZE: Be sure to visit View | Options and set up your fonts if you use Reflector for presenting. Set your fonts before you present, or call Reflector /fontsize:14 when you start it for a talk.
  • REGISTER WITH EXPLORER: Run "Reflector /register" if you want "Browse with .NET Reflector" to be your default option for all .DLL files.
  • ASSEMBLY LISTS: After you run Reflector, press Ctrl-L and bask in the little-known but totally awesome Assembly Lists feature. I use this for different projects as it let's me "switch views" very quickly. Setup as many lists as you like.
    • Remember that if your list gets "sloppy," just hold down delete and quickly remove every assembly. Then hit Ctrl-L and enter, and you'll be able to select a new Default list and be prompted for a version of the .NET Framework, including Mono if you have it installed.
  • EXPLOIT ANALYZE: Try the new improved Analyze feature by right-clicking any type or Assembly or by pressing Ctrl-R. The new items are Exposed By, Instantiated By, and Assigned By. Exposed By is VERY useful.
    • Also, not new, but still great, is the P/Invoke Imports analysis, that only appears when you've selected Analyze while an assembly (not a namespace) is selected. Try selecting System.Web, Right-Click, Analyze, then P/Invoke and see what unmanaged code your "pure" .NET application is using.
  • GET ALL THE ADD-INS: Finally, go load up on Reflector Add-Ins at CodePlexSo many people use Reflector, but it's profoundly a bummer that so few really exploit the available add-ins. Try the Diff add-in and the TreeMap to start, and once you're hooked, collect them all and trade them with your friends.
  • PUT IT IN YOUR PATH: Oh, and one other thing, folks. Forgive me for this rant, but if I go to another person's machine to debug or work with you for some reason, and Reflector.exe isn't in your path, I'm going to smack someone. Please, let me at least Start|Run|Reflector. If it's in c:\utils\tools\bar\my downloads\foo\reflector, fine, but for the love of .NET, make sure it's in your PATH.

Thanks Lutz! We all owe you.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Tuesday, February 20, 2007 9:37:36 AM UTC
Erm... psst... you spelt the name of the product wrong in the post title :)

Spiffy new version tho. Congrats Lutz!
Dan F
Tuesday, February 20, 2007 10:21:23 AM UTC
Greatest tool for .net ever, got it through built in update. Good tip about path, but I use Google Desktop so by typing Ctrl, Ctrl , [App name] I can start anything from anywhere.
Pop Catalin
Tuesday, February 20, 2007 10:39:40 AM UTC
Yup, this tool is so good it hurts.

If you want to read the 'What's New' PowerPoint presentation but don't have PowerPoint, I've taken the liberty of converting the PPT to a PDF - read it on my blog:

http://www.andrewbibby.co.uk/index.php/2007/02/20/lutz-roeders-reflector-50-released/
Tuesday, February 20, 2007 11:54:12 AM UTC
Someone corrected a typo in the code uri on my blog so I am here to pay it forward.
You have an http:// in the beginning of the href of your example.
Tuesday, February 20, 2007 12:18:07 PM UTC
The link is broken, starts with http://code://
Tuesday, February 20, 2007 3:07:50 PM UTC
Scott,

Will you please, please, please try and bully Lutz into doing a Hanselminutes with you. I know that Karl's tried to get him on DNR before, but your show may suit him more. I think the level of professionalism he shows to this free tool is just amazing and would like to hear what he has to say on any topic. Also, the support that he gives to Reflector plug-in developers is pretty astounding.

If he had a PayPal donate button, I for one would press it.

Martin.
Tuesday, February 20, 2007 3:51:57 PM UTC
I'll add one additional must do for reflector - add it to the tools menu in VS. Add it as a tools - External tools. Here's what I put for Arguments:

/fontsize:14 /fontfamily:Arial $(TargetPath)

Automatically pulls up the current assembly you are working on.
Tuesday, February 20, 2007 4:18:12 PM UTC
The PATH might make sense if you have a single folder with a bunch of utilities. Otherwise, you can safely leave your DOS tricks behind and just add an entry for reflector.exe to:
HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths
Set the (Default) string value to the full path to the executable. Start|Run glory, the Windows way.
Tuesday, February 20, 2007 5:08:57 PM UTC
That code:// link is my favorite new feature, too. I'd jokingly put reflector:// links in old blog posts; time to update them. I used Joshua's trick to add Reflector to the path. My c:\utils\ folder is categorized into subfolders by type, so adding individual utilities to the path would make it pretty cluttered. Now the watch for updated plugins (FileDisassembler, for one) begins!
Tuesday, February 20, 2007 5:31:39 PM UTC
Take a look at the Test Driven.NET integration...you can right-click on any assembly and it'll open in reflector..kind of what you have, on steroids.
Scott Hanselman
Tuesday, February 20, 2007 7:54:50 PM UTC
You mention that reflector should be in your path. That gives me an opportunity to exploit a (ruby) gem I created a few weeks ago which makes managing your path a breeze. Instead of going to My Computer | Properties | Blah blah and adding the path entry using that terrible dialog, just follow these steps:

gem install patheditor
path_editor --add c:\path\to\reflectore

Adding items to the Windows Path is so painful, I created this utility to make it a little easier for everyone.

It uses a WSH object to update your USER path setting, and the change will be permanent - current and future command prompts will see the new path. Unfortunately, slickrun does not respect path updates so you'll have to kill it and restart if you launch prompts from there ...
Justin
Tuesday, February 20, 2007 8:03:32 PM UTC

I was using Salamander about two years ago and, in my opinion, it was better than Reflector.
Both products have evolved and I wonder if Reflector 5.0 has all the features of the latest Salamander. (I am not sure if Salamander is still being supported and upgraded)
abdu
Tuesday, February 20, 2007 11:20:19 PM UTC
@Justin - How is that better than just adding them from the PATH DOS command:
c:\>PATH "C:\Program Files\Folder To Add\";%PATH%
Wednesday, February 21, 2007 3:45:18 AM UTC
Hey Scott ... I don't put Reflector in my path, but run Launchy. It's less typing than using the Run dialog box, because I just type altspace-r-e-f-enter.
Wednesday, February 21, 2007 11:08:56 AM UTC
Scott,
I linked to your post about reflector however when you changed your title due to the spelling mistake the link broke.
Is there not a better way to preserve links??
steve flitcroft
Wednesday, February 21, 2007 2:59:43 PM UTC
Hi,

Here is a quick tip on how to organize all your favorite utilities.
1. Create a C:\Utils folder.
2. Put the C:\Utils in you Path.
3. Create Symbolik link using Vista mklink (cd c:\Utils;mklink Reflector.exe "c:\Program files\Reflector\Reflector.exe") or NTFS Link ShellExtension .
Shay Erlichmen
Wednesday, February 21, 2007 4:46:00 PM UTC
Steve - you've discovered one of the problems with DasBlog...permalinks are based on titles, unless you use the Guid. I'll have to put in a manual redirect.
Thursday, February 22, 2007 8:25:22 PM UTC
@Jon

Updating path that way only affects your current command prompt. My script uses WSH objects to propagate the change to all running processes (that respect the update), and future prompts will include the new path.

The script will also not add duplicate entries, and it can even clean duplicate/non-existent directories out of your current path.
Justin
Saturday, February 24, 2007 1:39:20 PM UTC
>> you've discovered one of the problems with DasBlog...permalinks are based on titles, unless you use the Guid. I'll have to put in a manual redirect.

(Sorry to hijack this thread, but I mentioned this on the dasBlog dev-list before but it didn't seem to interest anyone...)

Yeah, that's what's really bothered me about my dasBlog. Here's what dasBlog needs (WordPress has most of this):

* A "slug" seperate from the title used for the permalink.
* The slug should be populated via Javascript when title first entered.
* The slug should use dashes to seperate words, not underscores[1].
* Changes to a slug after first publish should record an automatic redirect.
* The users should be warned when a changes would override a prior slug.

I haven't had the time to figure out how to get a dasBlog development environment set up or I would have tried myself.

-Mike

[1] http://www.mattcutts.com/blog/dashes-vs-underscores/ (this is 'Google Guy')
Thursday, March 08, 2007 11:02:50 PM UTC
Reflector 5's code:// feature is very cool, but I could not get Ctrl-Alt-C to work as described in this post. It turns out that exact key combo is used by the multi-protocol instant-messaging client Trillian, so every time I pressed that key combo, it would bring up Trillian's configuration dialog in the background on my second monitor where I didn't see it. If you have this program installed, simply select "Trillian" -> "Trillian Preferences" from the menu, then "Advanced Preferences", "Automation", and either change the hotkey or disable it altogether. Hope this helps someone else.
Parag
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.