0

Context:

  • Solution A is a program
  • Solution B is a DLL

Hi, I have a C# solution A that uses the output DLL from solution B (Also C#). I happen to have a crash in the solution A due to a failing function in the solution B. I am using visual studio debugger with the solution B on the program from the solution A. The debugger won't stop even if the DLL is compiled in debug and that the PDB is present.

How should I setup my debugger to catch the error in the solution B from the solution A?

MathieuAuclair
  • 1,229
  • 11
  • 41
  • 1
    I would recommend adding the project for the class library to Solution A. Right-click the Solution in the Solution Explorer > Click Add > Existing Project. Then browse to the .csproj file for the class library in Solution B. Then make sure to add a reference to the class library in the Solution A project. Right-click References > Add Reference > Expand Project, Solution > Locate class library from Solution B and check the checkbox – DotNetPadawan Sep 20 '19 at 19:04
  • I will try, let me 5 minutes – MathieuAuclair Sep 20 '19 at 19:06
  • It does not work as my solution A is generated each time I save, it's a script manager, so if I edit my solution, save, everything gets reloaded and the reference to the project is gone – MathieuAuclair Sep 20 '19 at 19:13
  • 1
    You could try turning off "Just My Code" see this question: https://stackoverflow.com/questions/32048766/what-is-just-my-code – DotNetPadawan Sep 20 '19 at 19:15
  • If you are able to open solution B in another instance of Visual Studioand then run it with breakpoints before the failing function. Then referencing the solution B in your solution A, run the solution A. When it calls the solution B's function it should hot the breakpoint. –  Sep 20 '19 at 19:15
  • 1
    This worked for me: https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-debug-from-a-dll-project?view=vs-2019 – user10728126 Sep 20 '19 at 19:17

0 Answers0