How can I debug .Net Core source code or Base class libraries (coreFx)?

I am using .NET Core 1.0 and Visual Studio 2015 Update 3 to create a simple Asp.Net Core MVC website.

How to debug my application and "Step in" the source code of .NET Core which is available in GitHub?

In particular, I am trying to fix one problem using the Microsoft.AspNetCore.Authentication.Facebook 1.0.0 assembly, which I extracted from NuGet.

+6
source share
3 answers

I wrote this article more than 1 year ago, so it’s a little outdated, but the idea is the same:

  • You are syncing with the correct tag from GitHub. In your case, you probably want to sync with the 1.0.0 tag
  • Create this repository by running build.cmd or build.sh
  • Add the path to the src folder to the global.json application global.json . For example, if you cloned Security in D:\Security , add D:/Security/src in global.json in the projects property.
  • Restore everything and it should work.

PS: If you use VS and don’t see the new code right away, try restarting it. This is a known issue that sometimes it does not pick up changes in global.json

+11
source

Update to the new VS 2017

In Visual Studio 2017 15.3.5 and later, we can use SourceLink support to debug core Core Core and ASP.NET Core components. vs 2017 options enable source link To enable source code support, disable Include only my code and enable Enable source link support . Then turn on Microsoft Symbol Servers. vs 2017 options enable symbol servers


The answers of the winners work well with vs 2015. For those who are looking for a solution compared to 2017,
In vs 2017 there is no global.json availble.So instead of adding the path to the folder in global.json you need to add a link to the project and rebuild.
All the others mentioned in the Victors article work the same way as with 2015.
It is important that the git hub tag and nuget package matches have the same version.

+4
source

Also, make sure that at the solution level you have a configuration project configured for debugging. See screenshot.
. enter image description here .

(To find solution properties, right-click on .sln in the solution explorer.)

0
source

All Articles