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.
- Yes I disabled 'just my code'
- Yes I enabled 'framework source stepping'
- Yes I enabled source server support (and also enabled all sub-options for good measure)
- Yes I disabled 'require source to match exactly'
- Yes I disabled 'step over properties and operators'
- 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?