How to debug a referenced dll (having pdb)

后端 未结 10 1855
孤独总比滥情好
孤独总比滥情好 2020-11-27 09:49

I have two solutions in my workspace, say A and B.

Solution A is an older project which I finished coding some time ago. In solution B, I need to use some classes fr

10条回答
  •  清酒与你
    2020-11-27 10:35

    The most straigh forward way I found using VisualStudio 2019 to debug an external library to which you are referencing in NuGet, is by taking the following steps:

    1. Tools > Options > Debugging > General > Untick 'Enable Just My Code'

    2. Go to Assembly Explorer > Open from NuGet Packages Cache

    3. Type the NuGet package name you want to debug in the search field & click 'OK'

    4. From the Assembly Explorer, right-click on the assembly imported and select 'Generate Pdb'

    5. Select a custom path where you want to save the .PDB file and the framework you want this to be generated for

    6. Copy the .PDB file from the folder generated to your Debug folder and you can now set breakpoints on this assembly's library code

提交回复
热议问题