[英]Is there a tool or strategy for figuring out all .dll and nuget packages that a project needs to reference?
I am using some third party .dll that references several nuGet packages internally.我正在使用一些在内部引用多个 nuGet 包的第三方 .dll。 In order for me to be able to use that third party .dll, I need to somehow figure out what NuGet packages I need to install.
为了让我能够使用第三方 .dll,我需要以某种方式弄清楚我需要安装哪些 NuGet 包。
Is there a tool or strategy that will assist me in determining which NuGet packages I am missing?是否有工具或策略可以帮助我确定缺少哪些 NuGet 包?
I have attempted to run my program, and an exception was thrown that said I was missing a package.我试图运行我的程序,但抛出了一个异常,说我丢失了一个包。 I installed that package and don't get that error anymore.
我安装了该软件包,不再出现该错误。 However, I do get an error that says:
但是,我确实收到一条错误消息:
The type initializer for 'SomeStaticClass' threw an exception
I suspect that I am still missing some references.我怀疑我仍然缺少一些参考资料。 Any ideas on how to figure out what references or NuGet packages I'm missing?
关于如何找出我缺少哪些引用或 NuGet 包的任何想法?
What I do in these circumstances is use a tool called " Just Decompile " (there are many of these tools, this is just the one I currently use.)在这种情况下,我所做的是使用一种名为“ Just Decompile ”的工具(这些工具有很多,这只是我目前使用的一个。)
It integrates in to Windows Explorer so you can right-click on a managed DLL/EXE and the context menu will popup and give you an option to "Open with Just Decompile" At that point, a UI will pop up and show you everything it references: managed AND native libraries:它集成到 Windows 资源管理器中,因此您可以右键单击托管的 DLL/EXE,上下文菜单将弹出并为您提供“使用仅反编译打开”的选项此时,将弹出一个 UI 并向您显示它的所有内容参考:托管和本机库:
So you can see here that the "LCCShell.exe" depends on a couple managed libraries that are not available to be resolved.因此,您可以在此处看到“LCCShell.exe”依赖于无法解析的几个托管库。 I would need to figure out how to get those.
我需要弄清楚如何获得这些。 Most of the time the namespace is all I need to find it in Nuget.
大多数情况下,命名空间就是我在 Nuget 中找到它所需的全部。 It also show you the native libraries as well, which is really convienient.
它还向您展示了本地库,这非常方便。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.