ramnz
ramnz

Reputation: 629

How can avoid the window "No source available" while stepping into debug mode on VS2010 SL5

How to avoid the window "No source available" while stepping into debug mode on VS2010 SL5 enter image description here

Upvotes: 11

Views: 16109

Answers (5)

Laurie Stearn
Laurie Stearn

Reputation: 999

Regarding VS2019, a description for the issue is provided at MSDocs.
For the requisite vcruntime and ucrt source files, the problem can occur after importing from a previous VS version which has since been uninstalled.
To prevent VS from using the old directories, find the solution property pages and navigate to the Debug Source Files Dialog Box. Click the tick button to check the entries where any invalid ones can be removed. The vcruntime and ucrt source should always exist in the directories, and the path at the top of the Browse to find source code dialog should always show the correct path.
In my case, because of a venerable drive bug, it is given to prompt for the "D" drive instead of the "C" drive. Further, the provided path cannot be pasted over to refresh the view, so, if none the wiser, one has to use the dialog to navigate all the way up to the required location from the desktop or equivalent.

Upvotes: 1

Govind T
Govind T

Reputation: 41

I tried all the suggested fixes; Nothing worked for me. I finally figured out the solution after several hours of trial & error iterations.

It turns out that the 'No Source Available' error is due to a stack-overflow within the VS debugger env.

The C/C++ code function that was supposed to be stepped-into (by VS debugger), was using a variable that was initialized to a stack array of a few MB in size. When I replaced this with a heap allocation, VS was successfully able to step into the code.

This worked for me.

Please note that in my case, the actual code (with the stack allocation) ran without a stack-overflow error within the debugger (if I skip the No source available error). It was just that VS's debugger's was not able to step-into a particular function sitting inside another C/CPP file, because of the internal stack overflow.

Hope this helps.

Upvotes: 3

Mojtaba Rezaeian
Mojtaba Rezaeian

Reputation: 8736

Here there is an extension for this issue:

http://erwinmayer.com/labs/visual-studio-2010-extension-disable-no-source-available-tab/

But in my own experience before finding this article (I was in page but I was trying to fix it myself without reading article) I have fixed this problem just by accepting a confirmation message saying something like "Selected source file is different from compiled assembly. Are you sure you want to use this file for debug?". But I can't remember exactly what I did to get this message. I think there was a linklabel which I clicked on "No source available" window and then confirmation message appeared and after confirm the problem ran away.

Upvotes: 0

Steve
Steve

Reputation: 216303

In Tools, Options, Debug, General Page. Check if you have 'Enable .NET Framework source stepping' enabled, if it is enabled, disable.

Upvotes: 3

Casey
Casey

Reputation: 10936

You can hit Shift+F11 to step out and it will complete whatever unavailable function it is in and stop at the next line (it may be unavailable as well, but continue to use Step Out until you get to code you want to examine.)

Upvotes: 1

Related Questions