Daniel_Kamel
Daniel_Kamel

Reputation: 619

View source code of built in function from inside Visual Studio 2017?

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

Upvotes: 0

Views: 1295

Answers (2)

Zakk Diaz
Zakk Diaz

Reputation: 1093

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

Upvotes: 1

Stefan Mayer
Stefan Mayer

Reputation: 5

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

Upvotes: 1

Related Questions