Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browsing the .NET Framework source code from Visual Studio

I know that I can set up Visual Studio to debug through the .NET framework source code.

But is there a way that I can browse the code while NOT debugging - i.e., being able to press F12 or "Go to definition"?

I thought that if that feature isn't built into Visual Studio then there may be a plug-in that might add it?

like image 434
Xavier Poinas Avatar asked Mar 14 '12 03:03

Xavier Poinas


People also ask

How do I Debug .NET code in Visual Studio?

Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.


2 Answers

There is a very new feature in Visual Studio 2017 version 15.6

You can see decompiled source code without any plugin! Btw, Ref12 doesn't work for VS2017.

Tools > Options , expand Text Editor > C# > Advanced, and enable "Enable navigation to decompiled sources (experimental)".

Ref: https://docs.microsoft.com/en-us/visualstudio/ide/go-to-and-peek-definition?view=vs-2017#view-decompiled-source-definitions-instead-of-metadata-c

like image 140
John_J Avatar answered Sep 21 '22 16:09

John_J


With ReSharper it's possible to browse .NET sources by enabling ReSharper -> Options -> Tools -> External Sources -> Navigation to Sources. After enabling this option new menu item "Navigate To -> Decompiled Sources" appears by right click on type/method/whatever. Navigation also works with F12 for me.

like image 33
tytyryty Avatar answered Sep 25 '22 16:09

tytyryty