I'm trying to debug .NET Framework's source code using Visual Studio 2010 Professional. I followed the steps described in Raj Kaimal's post, but I must be doing something wrong since the only code I'm getting to see is the disassembly code:
(source: github.com)
As you can see in the image, the Go to Source Code and the Load Symbols options are disabled. Nevertheless, symbols are downloaded from Microsoft's server since I can see them inside the local cache directory.
The code I'm debugging goes as follow:
var wr = WebRequest.Create("http://www.google.com");
Console.WriteLine("Web request created");
var req = wr.GetRequestStream();
Console.Read();
When I hit F11 to step into the first line of code, a window pops us looking for the "WebRequst.cs" file inside "f:\dd\ndp\fx\src\Net\System\Net\WebRequest.cs" which does not exists on my machine.
What am I missing?
To enable the Disassembly window, under Tools > Options > Debugging, select Enable address-level debugging. To open the Disassembly window during debugging, select Windows > Disassembly or press Alt+8.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
You can normally see assembly code while debugging C++ in visual studio (and eclipse too). For this in Visual Studio put a breakpoint on code in question and when debugger hits it rigth click and find "Go To Assembly" ( or press CTRL+ALT+D )
The Disassembly Window shows the program execution in assembly code, or, intermixed with the source code (device dependent). When the Disassembly Window is the active window, then all debug-stepping commands work on assembly level. Open the window with the menu View — Disassembly Window.
In project properties, target .NET Framework 4.0. I had the same issue when I was compiling for .NET 3.5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With