Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2008: How to load source code while debugging

When debugging in Visual Studio 2008 I get the error "There is no source code available for the current location" but it does not prompt me to browse for source code. If I click "Show Disasembly" and then right click to select "Go to source code" I get the error "The source code cannot be displayed.

How do I load the source code while in debug mode?

Edit: I have the source code (it is just another class which is not part of this solution) and it is compiled in debug mode.

like image 911
jellomonkey Avatar asked Jul 17 '26 23:07

jellomonkey


2 Answers

If you are debugging from a different location to where you originally built the solution, i.e. you have attached to a process which has debugging symbols:

You can tell visual studio where the source is located by right clicking on the solution in the solution explorer and adding the path-to-your-source to the "Directories containing source code" under the "Debug Source Files".

I have tried this under VS2008 only.

like image 55
Mike Avatar answered Jul 20 '26 15:07

Mike


I just found the problem. There was an incorrect reference in a project just checked in by another developer. This is why I hate solutions with 20 projects.

like image 29
jellomonkey Avatar answered Jul 20 '26 13:07

jellomonkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!