Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug .NET Framework's source code only shows disassembly in Visual Studio 2010

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:

Alt text
(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?

like image 411
jdecuyper Avatar asked Apr 28 '10 21:04

jdecuyper


People also ask

How do you debug disassembly?

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.

How do I debug .NET code in Visual Studio code?

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.

How do I show assembly code in Visual Studio?

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 )

What is disassembly window?

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.


1 Answers

In project properties, target .NET Framework 4.0. I had the same issue when I was compiling for .NET 3.5.

like image 93
James Avatar answered Nov 14 '22 10:11

James