C
C#2mo ago
Ryan Chen

How to debug runtime/libs in Visual Studio?

My goal is to learn the source code in runtime/libs through debugging, but I am having difficulties with it. Can I directly create a console application and reference the project for debugging? According to the workflow, I need to load dotnet.exe from the .dotnet directory into the solution and configure it for debugging. However, during the debugging process, I found that the symbol files don't seem to match the code I am debugging. What should I do?
6 Replies
Sossenbinder
Sossenbinder2mo ago
You mean debugging and stepping through the official .net runtime libs?
Ryan Chen
Ryan Chen2mo ago
Yes, I want to debug by directly referencing the project (e.g., System.Collections.csproj)
Sossenbinder
Sossenbinder2mo ago
Most IDE's support automatic debugging into source, Rider does for example. I'm not entirely sure how VS does it since I don't use it anymore, but IIRC there should be an option "Enable Just my Code".
Sossenbinder
Sossenbinder2mo ago
There's usually also on-the-fly decompilation in major IDEs
Ryan Chen
Ryan Chen2mo ago
This is very useful. I successfully debugged the runtime/libs code. Thank you very much.
Want results from more Discord servers?
Add your server