0%

How to make TestDriven.NET open dotPeek (or any other IL disassembler) instead of Reflector

TestDriven.NET is a free (for personal use) test runner for Visual Studio, that allows you to run unit tests from the context menu (“Run Tests*) using any unit testing framework. What I like particularly about TestDriven.NET, is that it allows running or debugging any arbitrary method as well!

TestDriven.NET comes with a .NET Reflector integration plugin, allowing you to right-click anywhere in the class and choosing Go To Reflector. After the RedGate Reflector fiasco many companies created their own (free) Reflector alternatives. Until Jamie Cansdale (creator of TestDriven.NET) updates his wonderful product to reflect (pun somewhat intended) the changes in the .NET world, here’s what you can do to trick TestDriven.NET to open any Reflector alternative: Image File Execution Options.

I previously wrote about using Image File Execution Options to debug a process that is crashing on startup. We can use it to have Windows open any executable when reflector.exe is requested:

  • Run regedit.exe
  • Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  • Create a new key named reflector.exe
  • Create a new string value under reflector.exe. The name of the string value is Debugger, and the value should be a path to your preferred tool, e.g.:
    C:\Program Files (x86)\JetBrains\dotPeek\v1.0\Bin\dotPeek.exe

Now, when you press Go To Reflector, it will open dotPeek instead.