0

Is it possible to view the source code of a built-in function directly from visual studio 2017? For example if I want to view the source code of the WriteLine function, I selected it, right clicked it, and when I pressed on Go To Implementation, it gave me this message: enter image description here

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Daniel_Kamel
  • 610
  • 8
  • 29

2 Answers2

1

în Call stack you can choose something like "Show External Code", should resolve your problem.

1

What you need are the .pdb files. Every .dll needs a corresponding .pdb file that maps the .dll to the source code. For your example, System.Console, you need the .pdb file for mscorlib.

The following pages show how to load this pdb file https://social.msdn.microsoft.com/Forums/SECURITY/en-US/166c70e7-9e39-44bf-8e08-76231e59ec34/mscorlibpdb-not-loaded?forum=visualstudiogeneral "mscorlib.pdb not loaded" yet the mscorlib.dll is NOT missing

Optionally, if you feel risky enough, you can download the the c# project and try to compile the .pdb file your self https://referencesource.microsoft.com/download.html

Zakk Diaz
  • 1,063
  • 10
  • 15