2

I am trying to step into a form.Show() method (to figure out why calling Show on one mdi child triggers a resize on all other mdi siblings), however no matter what I do I can't get visual studio to step into the show method.

  1. Yes I disabled 'just my code'
  2. Yes I enabled 'framework source stepping'
  3. Yes I enabled source server support (and also enabled all sub-options for good measure)
  4. Yes I disabled 'require source to match exactly'
  5. Yes I disabled 'step over properties and operators'
  6. Yes I enabled 'microsoft source servers'

When I open the modules window, System.Windows.Forms shows 'Symbols Loaded'. When I ctrl+click on the Form.Show() method, it takes me to the code. When I enter a breakpoint, the breakpoint is disabled and it says 'No Symbols loaded'

I have tried this with both VS2019 and VS2022 and both exhibit the same behavior.

So it looks like some parts of VS know where to find the symbols and other parts of VS (namely the debugger) can't find the symbols. Is there any way to get all of Visual Studio on the same page with regards to where to find the symbols?

Also I have tried this: https://stackoverflow.com/a/10908685/229250 It didn't help.

The callstack (which I would assume shares the same context as the debugger) also has no idea where to find the symbols. When you double click on any part of the stack that has to do with dotNet framework method calls, I get a screen that says 'Source information is missing from the debug information for this module' with NO option to select a source file (I downloaded the source expecting to be able to do this but nope).

What's even more strange is that in VS2022, when you run the debugger and you open 'Solution Explorer' there is a section that appears at the top called 'External Sources', under that there is a node 'Modules without sources'. Under that node I have 2 copies of System.Windows.Forms.dll. When you right click on one of them and select "Symbol Load Information" it says symbols were loaded and shows the path to the local symbol server download cache. When you do the same for the other copy of the dll, it shows "Binary was not built with debug information." and ALL of the framework dlls have the same problem and I can't step into any framework code or set any breakpoints.

@Hans Passant Here is the symbol load info you requested (from the modules window): C:\projects\MyProject\bin\Debug\System.Windows.Forms.pdb: Cannot find or open the PDB file. C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.pdb: Cannot find or open the PDB file. C:\WINDOWS\System.Windows.Forms.pdb: Cannot find or open the PDB file. C:\WINDOWS\symbols\dll\System.Windows.Forms.pdb: Cannot find or open the PDB file. C:\WINDOWS\dll\System.Windows.Forms.pdb: Cannot find or open the PDB file. C:\Users\myUserId\AppData\Local\Temp\1\SymbolCache\System.Windows.Forms.pdb\098daa586c564b1ab756109f800f14ff1\System.Windows.Forms.pdb: Symbols loaded.

As I mentioned above, if you try to get the load info from other places, it says symbols aren't loaded.

EDIT 1

So it seems there is a problem in visual studio, even though I have all my projects set to Framework v4.6, the Modules window shows that the version of Winforms being loaded is 4.8.3752.0 built by: NET48REL1

Is there any way to get VS2022 to load the same version of Winforms that the project is set to?

Bitfiddler
  • 3,942
  • 7
  • 36
  • 51
  • Use Debug > Windows > Modules and locate System.Windows.Forms.dll in the list. The Symbol Status column should be "Symbols loaded". The Symbol File column gives you the path to the .pdb file. That's the one you want to delete, forcing it to be downloaded again, but now from the reference source server. Right click the line and choose Symbol Load Information to get conformation that this actually happened. – Hans Passant Dec 23 '21 at 21:33
  • The path is to the symbol cache that comes from the Microsoft symbols servers (which I assume is what you mean by reference source server). Clearing this and re-downloading did nothing. – Bitfiddler Dec 23 '21 at 21:37
  • Copy/paste the Symbol Load Information into your question so we got some facts to go by. – Hans Passant Dec 23 '21 at 22:07
  • @HansPassant See above. – Bitfiddler Dec 23 '21 at 22:27
  • You have to delete the .pdb file to get a useful trace that shows where the new .pdb came from. – Hans Passant Dec 23 '21 at 22:30
  • I don't understand your comment. If I delete the file, Visual Studio will just download it again from the Symbol server and I get the exact same result in the "Symbol Load Info". – Bitfiddler Dec 23 '21 at 23:11

0 Answers0