I ran into a problem this morning where Visual Studio 2008 wasn’t letting me debug through some source files. These files weren’t part of my solution, I was getting them from an external share. I’d checked all the obvious things; enable just my code was disabled and the symbols were loading correctly. Alas, the “Go To Source Code” menu item was still grayed out.
Turns out that at some point I’d been stepping through code and told VS to not load this file (because the share wasn’t available) and it has used this as the default behavior ever since. By “told VS” I mean at some point I stepped into a method and the Find Source dialog came up and I chose “Cancel”. VS stores a list these ignored source files in the solution settings and will not ask you again. It gives you no indication as to why the source is unavailable – room for some UI improvement here I feel.
How to fix it
To reset the solution do the following:
- Open the solution properties dialog (right-click on the solution in the Solution Explorer).
- Open the Common Properties node and select Debug Source Files.
- Remove the files from the “Do not look for these source files” list.
- Click “Apply”.
- You may have to reload the solution to get these new settings applied.
Now you should be able to view the source or at least VS will show you the Find Source dialog again.
This only cost me a few hours. My Christmas present to you, an hour or two of your life back. Enjoy.
Currently listening to:
Foo Fighters – The Colour and the Shape