Until now I’ve always used the ASP.NET MVC framework source for debugging ASP.NET MVC. On my laptop I just tried a different approach, namely bringing up the “Modules” window in VS while I am debugging and right-clicking System.Web.Mvc, then select “Load Symbols From” > “Microsoft Symbol Servers”.
VS seemed to actually load something since the symbols file for the System.Web.Mvc assembly was reported as loaded. Also, all lines belonging to System.Web.Mvc in my call stack have gone from grey to black. However, I still get the “Source Code Not Available” error message when trying to step into code belonging to System.Web.Mvc.
So, I loaded the symbols, but still no source code. Not a big problem since I can still debug it the old way. But I am wondering what the Microsoft Symbol Servers are useful for then?
They make stack traces work properly for native DLLs – without symbols, your stack traces often only go as far as the nearest Windows DLL and then stop. With symbols, they continue through the Winodws DLLs. You can see the function names, but not the source code (obviously).
Debugging a native Windows program, you often get stack traces like this:
Without the symbols for the Windows DLLs, you’ll find that the stack only gets this far:
and you don’t get to see all the way back to the start.