简体   繁体   中英

Can I Debug a NuGet Package?

We have some helper methods that get deployed to NuGet. I have pulled down that repository locally, and pointed my project to use the local NuGet package.

I am trying to debug the NuGet package, should I be able to "Go to Implementation" or somehow get to that code?

A colleague recommended just copying the NuGet project into my solution, but it seems like there should be a way to debug the NuGet code. Or is the source for NuGet packages not available / is pre-compiled? I am a bit lost.

The NuGet package is just a compiled dll that your app references, consider it a convenience rather than downloading and referencing it manually.

You should include the NuGet source as a project in your solution and be able to debug it like any other code you already have (and also be happy that it's available to download while doing so :)

EDIT: As stated in the comments there is another way also which is viable if the symbols are available in the SymbolSource repository which you can use as explained here

In cases in which you don't have access to the source you can use something like ILSpy to decompile the dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM