简体   繁体   English

是否有工具或策略可以找出项目需要引用的所有 .dll 和 nuget 包?

[英]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.

相关问题 如何引用 NuGet 包? - How to reference NuGet packages? 具有NuGet依赖项的参考DLL - Reference DLL with NuGet dependencies NuGet包无法为lib目录中的DLL添加对项目的引用 - NuGet Package fails to add reference to project for DLL inside lib directory 如何将 dll 作为引用包含在 nuget 中,当 nuget 添加到项目时,该引用也被复制为引用 - How do I include dll as reference in nuget that also gets copied as reference when nuget added to project 升级项目时是否需要更新所有nuget包? - Is it necessary to update all nuget packages when upgrading a project? 我正在开始一个新的 .Net Core 项目,但我不知道我应该如何为 nuget 包实现可为空的引用类型 - I am starting a new .Net Core project and I can't figure out how am I supposed to implement nullable reference types for nuget packages Nuget在“\\ .nuget \\ packages”中查找本地项目 - Nuget looking in “\.nuget\packages” for local project NuGet将项目依赖项打包为nuget依赖项 - NuGet packages project dependencies as nuget dependencies 为WebAPI项目添加nuget包 - Adding nuget packages for a webapi project 该项目引用了此计算机上没有的NuGet软件包 - The project references NuGet packages that are not on this computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM