Comments
6 comments
-
Hi.
There are a couple of walkthroughs and demonstration videos here http://www.red-gate.com/supportcenter/Product.aspx?p=.NET%20Reflector which show the process.
When using Reflector Pro, you don't have to do any copying of sources from Reflector into Visual Studio. Visual Studio will be led by the debugging information that Reflector Pro generates to the de-compiled source code. -
Now a silly question on the same topic from me - how to
a) stop at entry of executable started with "Debug an Executable"
b) show all classes and methods in object browser as in usual Reflector, not only public? /*Show Hidden Types And Members does not do this*/
?
Thanks -
I have a very sneaky way to do 1:
Make a new ConsoleApplication. Don't write any code in it. Go to its properties page, to the debug tab. Choose "Start external program" and give it the program you want to run. Then press F11. This is a different use of the "Setting command line arguments" trick from here:
http://www.red-gate.com/supportcenter/C ... 948321.htm
Unfortunately, I've never found a way to make the object browser do 2. The only way to get to a internal class to set a breakpoint is to go to a nearby public class, then use File>Open. This will show the folder where reflector has decompiled the assembly, from which you can open the internal class. -
Thanks for the tips
But if i can try to understand that "break on entry" needs some tiny piece of code, the reason for removing private classes that are shown in classic reflector really does stuck me -
Hi.
Just to make it clear what Alex's tip does. If, for example, you compiled the following piece of code to MyApp.exe,
class Program
{
static void Main(string[] args)
{
Console.WriteLine("hello");
}
}
you'd end up with only private classes, so you couldn't navigate to the Main method via the object browser.
To stop on the first statement, you could set up MyApp.exe as the debug "start external program" in the properties of a new console application project. You could use the .NET Reflector "choose assemblies to decompile" menu item to bring up the dialog, and then browse to MyApp.exe and decompile it.
At that point, pressing F11 would step you to the first instruction of the decompiled code. For me, in a debug build, it stops on the first { of the Main method.
Stepping should then take you into private classes where you can set breakpoints once you have the source file loaded into Visual Studio. -
the reason for removing private classes that are shown in classic reflector really does stuck me
Ah, we didn't remove the private items. The Object Browser is part of Visual Studio, and doesn't show private types. I hoped we could control it well enough to show them, but we couldn't find a way.
Cheers,
Add comment
Please sign in to leave a comment.
How can I debug software using Reflector Pro if i don' have source code.
I start new project, choose dll's, then "Explore decompilld assemblies". There i can only add sources as reference.
Or i have to export sources from Reflector to VS ?