0

I recently had a problem today where I was getting:

There is no source code available for the current location

when stepping in to a function which I wrote and was part of the solution. Stymied, I did a little research and found this StackOverflow post. I looked in the Solution's properties and found:

enter image description here

How did "c:\MyFile.h" get added to this list? I did not add it. In fact, in 15 years of Windows programming, I've never even seen this dialog box before.

Community
  • 1
  • 1
John Dibling
  • 99,718
  • 31
  • 186
  • 324
  • I apologize for the low-quality freehand art. – John Dibling Dec 10 '13 at 16:23
  • It has been there for 8 years that I know of. Are you asking about the dialog, the "Do not look for" box or c:\MyFile.h? – Hans Passant Dec 10 '13 at 16:23
  • @HansPassant: No, I'm asking how the "c:\MyFile.h" entry was added to this list. I did not add it. – John Dibling Dec 10 '13 at 16:23
  • At some point in the past 5 years, the debugger landed on code whose PDB file said it lived in that .h file. But could not find that file so it displayed a dialog to allow you to specify the correct path. You clicked Cancel. – Hans Passant Dec 10 '13 at 16:27
  • @HansPassant: Aha! It was actually some point in the last 5 days, since the file in question is new. But I get your point. If you make than an answer I'll u/v and accept it, as I suspect you're exactly right. – John Dibling Dec 10 '13 at 16:45

1 Answers1

2

You'd typically add files, unseen, to the "Don't look for these" box while debugging. The common scenario is that the debugger landed on a line of code, it looked in the PDB file for the source code file and could not find it on your disk drive. It then displays a dialog to allow you to locate the file yourself. This is very common for example when you debug code that was built on a build server and it built the executable from source code directories that didn't match where you put it.

Clicking Cancel on the dialog then automatically adds the file it is looking for. The debugger will now leave you in peace, no longer prompting for that same file over and over again. You'll get the "There is no source code available" warning.

Removing the file from the dialog box is fine, you'll just trigger the debugger prompt again. The list of files is stored in the hidden .suo file in the solution directory so it maintains history for a potentially long time and it is solution specific.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536