Tag Archives: visual studio

Using Reflector to debug a .Net app in Visual Studio without the original source code

Many .Net developers use to say “if you’re a serious developer, then you MUST Reflector”.

I would like to add another statement: “if you want to have an insight and powerful look at how things works internally, use Reflector Professional”.

Last Wednesday, RedGate released a new version of Reflector. You’re probably going to download it soon or later because your actual version is going to expire. When you’ll download the free version, you’ll automatically get a trial (14 days) of the professional edition. Nice, but what’s so special about this edition ?

Let’s see a demonstration of what can be done using Reflector Pro. The following is not an ad for RedGate, I’m just totally amazed by their new feature 🙂

1. Reflector is now integrated into Visual Studio (2005, 2008 and 2010 RC):

2. Select the “Choose Assemblie to Debug…” option to select .Net assemblies for which you don’t have the source code. In this example, I’m using one of the Blend3’s assemblies:

3. Once the process is completed, select the “Explore Decompiled Assemblies” option:

4. Browse to your target assembly and select an interesting type:

5. Put a breakpoint in the code, like you do every day when you debug an app:

6. Run the executable

7. Debug Blend3’s source code ! Use breakpoints, step into methods, inspect variables…

And that’s it. With Reflector Professional, you can:

  • Decompile third-party assemblies from within Visual Studio
  • Step through decompiled assemblies and use all the debugging techniques you would use on your own code. This is incredibly powerful as we saw by debugging Blend3″s source code !

Reflector Professional is available for about 195$ on RedGate website

Review of 2009 blog posts

In the past year, I’ve posted more than 30 articles on my blog. Here is a summary of those posts (link in bold are those which got the most traffic during the year). Obviously, MVVM was a very hot topic during 2009 🙂

January

February

March

April

May

July

August

September

October

November

Browse your codebase like a pro with ReSharper

I’ve already blogged about R# a couple of times. There is no doubt: it’s a must have for any serious .Net developper. A few weeks ago I learned and setup new shortcuts to improve my navigation skills in Visual Studio.

Here are the results… If I want:

  • to find a Type I hit Ctrl+T
  • to find a File I hit Ctrl+Shift+T
  • to find a Member (in a file) I hit Ctrl+Alt+T (Note: I setup this one on my own using Tools/Options/Keyboard)

A search box opens and I can start searching instantaneously.

resharpernavigation1

Here are the basic scenarios :

  • I want to open the ViewModelBase class, I hit Ctrl+T and then VMB (R# is able to search using capital letters)
  • I want to go to the OnPropertyChanged, I hit Ctrl+Alt+T and then OPC (same as previous example)
  • Finally, to open the file in the Solution Explorer I hit Shift+Alt+L

It’s simply amazing the time we can save using those simple shorcuts. Of course, you need to be quite familiar with your codebase (if you just arrive on a project it will be harder :p)