How to debug code in NuGet package created by me

后端 未结 5 1991

I have a NuGet package I created and installed in another solution but now I need to debug the code of the package when called from my new solution.

I tried referenci

5条回答
  •  一生所求
    2020-12-04 18:17

    How to debug code in a nuget package created by me

    Just as NtFreX answered, "To debug any dll you need the symbol file of it (.pdb). ". So you can create symbol packages which allow consumers to step into your package code in the Visual Studio debugger.

    The way we do it (and works):

    1. Create "*.symbols.nupkg".
    2. Deploy symbol package to SymbolSource server.
    3. Configure IDE, Package consumers can add https://nuget.smbsrc.net/ to your symbol sources in Visual Studio.
    4. Add required Library to project using NuGet (from our SymbolSource server).
    5. Debug.

    For the detail info, you can refer to Creating symbol packages.

    If these packages are not suitable for publishing on NuGet Gallery/SymbolSource, you can put the *.nupkg and *.symbols.nupkg files on a local disk.

    Note: Add the source code to the Debug Source Files for the solution that references the package(Right click on Solution, select Properties...Common Properties...Debug Source Files, and add the root source directory for the relevant binary reference)

提交回复
热议问题