2

Environment: W10 Pro x64, Visual Studio Premium 2013 Update 5, Class Library project, target framework .NET 4.5.2.

I am trying to step into the .NET source while debugging my code, but for the life of me I cannot get it to work - hitting F11/Step Into results in the debugger just going to the next line of my source. I am trying to step into a call of Type.InvokeMember(). In the Modules window, I see mscorlib.dll has its symbols loaded. One interesting bit of info; not sure if it's relevant or not: the Path of mscorlib.dll is shown as

C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll

but the Version column says

4.6.1637.0 built by: NETFXREL3STAGE

So question #1: is this bad? (Also, here is the Symbol Load Information for mscorlib.dll):

C:\Program Files (x86)\Sage Software\Sage MAS 500 Client\PO\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Windows\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Windows\symbols\dll\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Windows\dll\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Temp\SymbolCache\mscorlib.pdb\a41a5f0d874946f7af63753340e70f252\mscorlib.pdb: Cannot find or open the PDB file. 
C:\Temp\SymbolCache\MicrosoftPublicSymbols\mscorlib.pdb\a41a5f0d874946f7af63753340e70f252\mscorlib.pdb: Cannot find or open the PDB file. 
SYMSRV:  C:\Temp\SymbolCache\mscorlib.pdb\A41A5F0D874946F7AF63753340E70F252\mscorlib.pdb not found
SYMSRV:  http://referencesource.microsoft.com/symbols/mscorlib.pdb/A41A5F0D874946F7AF63753340E70F252/mscorlib.pdb not found
http://referencesource.microsoft.com/symbols: Symbols not found on symbol server. 
SYMSRV:  mscorlib.pdb from http://msdl.microsoft.com/download/symbols: 133365 bytes 
http://msdl.microsoft.com/download/symbols: Symbols downloaded from symbol server. 
C:\Temp\SymbolCache\mscorlib.pdb\A41A5F0D874946F7AF63753340E70F252\mscorlib.pdb: Symbols loaded.


Also, if I hit F12 when my cursor is on the call to InvokeMember(), I get a new "Generated Source File" window with the name Type [from metadata] on the window tab. Mousing over the tab gives me the text

Preview of C:\Users\conrad\AppData\Local\Temp\6012$CommonLanguageRuntimeLibrary$v4.0.30319$NoDynamic\System.Type.cs [from metadata]

in the tooltip. There are 3 declarations of InvokeMember, for its 3 variants. The one with the most args is marked abstract (the version I am using), and the other 2 have the attributes

[DebuggerHidden]
[DebuggerStepThrough]

So - question #2 - are these attributes blocking me from stepping into the source? If so, is there a way to override?

It feels like I have looked at about every other SO question on stepping into .NET source, but with no success - here are my Debug options: VS 2013 Debug Options

And my Symbol Locations:

Symbol Locations

13
  • Obvious question: Do you have the .NET source installed? Commented Apr 12, 2017 at 22:23
  • @RayFischer I didn't install anything explicitly. Don't the symbol servers download the source on-demand? Commented Apr 12, 2017 at 23:52
  • @Conrad, if you change the .NET Framework version to 4.5.1, how about the result? Please also select "require source files to exactly match the original version", or you could change the symbol catch folder to a new blank path, debug it again. Commented Apr 13, 2017 at 10:31
  • @JackZhai-MSFT no luck after downgrading to 4.5.1 and selecting the "require source..." option. Commented Apr 13, 2017 at 17:32
  • 1
    @Conrad, Do you want to get the source code directly? referencesource.microsoft.com/download.html, maybe you could download it directly, and then refer to it, please clean and rebuild your project, debug it again. Commented Apr 18, 2017 at 10:46

1 Answer 1

2

Symbol servers contain ... symbols, not source.

From MSDN here

"A program database (.pdb) file, also called a symbol file, maps the identifiers that you create in source files for classes, methods, and other code to the identifiers that are used in the compiled executables of your project. The .pdb file also maps the statements in the source code to the execution instructions in the executables. The debugger uses this information to determine two key pieces of information: the source file and line number that are displayed in the Visual Studio IDE and the location in the executable to stop at when you set a breakpoint. A symbol file also contains the original location of the source files, and optionally, the location of a source server where the source files can be retrieved from."

The symbol servers contain symbols (names of functions, variables etc) they don't contain the source code. You can find the source code for mscorlib.dll here.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the info -- however, I am not seeing where I can download the source files for mscorlib.dll on that site -- is there a link I'm missing? Is there a place in VS to specify a Source Server (as opposed to 'Directories containing source code')?
Today there is a Download link at the top of the page. It gives you the chance to download ZIP files with all the source for frameworks 4.5.1 - 4.8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.