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
You mean debugging and stepping through the official .net runtime libs?
Yes, I want to debug by directly referencing the project (e.g., System.Collections.csproj)
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".
https://learn.microsoft.com/en-us/aspnet/core/test/debug-aspnetcore-source?view=aspnetcore-8.0 This seems like it contains the right config
There's usually also on-the-fly decompilation in major IDEs
This is very useful. I successfully debugged the runtime/libs code. Thank you very much.