Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Step through code in a referenced solution

Usually when I want to debug a nuget package I download the source code and add the .csproj file to my solution and add a project reference instead of using the nuget package. This lets me step through the code and see what is going on with my live project.

I have a nuget package I want to debug but it is very large. I downloaded the source code and the solution has around 20 projects in it. I tried just adding a few of them but ended up with lots of dependency issues.

Is there a way I can tell visual studio that the source code for the nuget package exists on my HD so I can step through it without having to add 20 projects to my current solution? Or perhaps some way to add a reference to the entire solution?

My goal here is to be able to set breakpoints so when the third party compiled code executes I can step through it and see what is going on. What is best way to do this?

like image 583
Guerrilla Avatar asked Dec 05 '25 07:12

Guerrilla


1 Answers

enter image description hereAssuming the application is .NET 4.7.2. You could try dnSpy which allows you to debug & edit a built executable/dll.

GitHub Page: https://github.com/0xd4d/dnSpy

Latest Release:https://github.com/0xd4d/dnSpy/releases/download/v5.0.0/dnSpy.zip

Once downloaded

  • Start up dnSpy.exe for 64-bit or dnSpy-x86.exe for 32-bit applications.
  • Use File->Open to locate your exe's and dll files.
  • Apply your breakpoints within dnSpy.
  • Hit start as you would in Visual Studio
like image 171
Emcrank Avatar answered Dec 09 '25 15:12

Emcrank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!