简体   繁体   English

我可以调试NuGet软件包吗?

[英]Can I Debug a NuGet Package?

We have some helper methods that get deployed to NuGet. 我们有一些辅助方法已部署到NuGet。 I have pulled down that repository locally, and pointed my project to use the local NuGet package. 我已在本地下拉该存储库,并指出我的项目使用本地NuGet包。

I am trying to debug the NuGet package, should I be able to "Go to Implementation" or somehow get to that code? 我正在尝试调试NuGet包,我应该能够“转到实现”还是以某种方式获取该代码?

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. 一位同事建议将NuGet项目复制到我的解决方案中,但是似乎应该有一种调试NuGet代码的方法。 Or is the source for NuGet packages not available / is pre-compiled? 还是NuGet软件包的来源不可用/是否已预编译? 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. NuGet软件包只是您的应用程序引用的编译的dll,请考虑使用它是一种便利,而不是手动下载和引用它。

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 :) 您应该将NuGet源作为一个项目包含在解决方案中,并能够像已经拥有的任何其他代码一样对其进行调试(并且也很高兴在此过程中可以下载它:)

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 编辑:如评论中所述,如果符号源在SymbolSource存储库中可用,则还有另一种可行的方法 ,您可以按照此处的说明使用

In cases in which you don't have access to the source you can use something like ILSpy to decompile the dll. 如果您无权访问源,则可以使用ILSpy之类的东西来反编译dll。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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