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:
Asked
Active
Viewed 929 times
0

Wai Ha Lee
- 8,598
- 83
- 57
- 92

Daniel_Kamel
- 610
- 8
- 29
-
1For .NET Framework you can look at source but not from within VS - https://referencesource.microsoft.com/ – DetectivePikachu Sep 20 '19 at 15:39
-
@DetectivePikachu I know I can always search it online, what I want is to do it directly from the visual studio if possible – Daniel_Kamel Sep 20 '19 at 15:41
-
2I believe you can do that with the Resharper extension – DetectivePikachu Sep 20 '19 at 15:49
2 Answers
1
în Call stack you can choose something like "Show External Code", should resolve your problem.

Stefan Mayer
- 5
- 1
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