.net Visual Studio 中的哪个程序可让我查看 DLL 以查看其 API?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/131985/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 10:05:03  来源:igfitidea点击:

Which program in Visual Studio lets me look into DLLs to see its API?

.netvisual-studio-2008

提问by Epaga

See the question. I want to see the methods and classes offered by a DLLs library.

看问题。我想查看 DLL 库提供的方法和类。

回答by Rob Cooper

This is exactly what the Object Browser is for.

这正是对象浏览器的用途。

  • Add a reference to the DLL.
  • Right click it in the list.
  • Click View in Object Browser.
  • 添加对 DLL 的引用。
  • 在列表中右键单击它。
  • 单击在对象浏览器中查看

回答by Knasterbax

For those coming from the old Visual Studio 6.0 days:

对于那些来自旧的 Visual Studio 6.0 时代的人:

Dependency Walkeris a nice free tool, that was formerly part of Visual Studio.

Dependency Walker是一个不错的免费工具,它以前是 Visual Studio 的一部分。

http://www.dependencywalker.com/

http://www.dependencywalker.com/

I like it still. Here is a screen shot:

我还是喜欢 这是一个屏幕截图:

enter image description here

在此处输入图片说明

回答by Thorsten79

There's also the DLL export viewerif you don't have VS installed on a machine.

如果您的机器上没有安装 VS,还有DLL 导出查看器

回答by Gary Willoughby

If the DLL is a .NET assembly you might want to take a look at Reflectorfor a more detailed view.

如果 DLL 是 .NET 程序集,您可能需要查看Reflector以获得更详细的视图。

回答by danielp

  • ILSpyis an open-source tool which allows you to browse an assembly's packages and classes and also to decompile code.

  • Another free-of-charge tool is JetBrain's dotPeek.

  • ILSpy是一个开源工具,允许您浏览程序集的包和类以及反编译代码。

  • 另一个免费工具是JetBrain 的 dotPeek

回答by Daemin

There's a dependency tracker tool that comes with the Windows SDK (formerly the Platform SDK), it's got a reasonable GUI for looking inside executables and DLL's.

Windows SDK(以前称为平台 SDK)附带了一个依赖项跟踪器工具,它有一个合理的 GUI,用于查看可执行文件和 DLL 的内部。

There are also some command line tools that you can use to see inside of dll's, dumpbin in particular - check the MSDN help in visual studio for more information. You can run these tools from the command prompt in the Visual Studio start menu folder.

还有一些命令行工具可用于查看 dll 的内部,尤其是 dumpbin - 查看 Visual Studio 中的 MSDN 帮助以获取更多信息。您可以从 Visual Studio 开始菜单文件夹中的命令提示符运行这些工具。

回答by Suma

Outside of Visual Studio, you can use a dependency tool which is able to inspect DLL and EXE imports and exports, it integrates with the shell and is very easy to use. It comes with some Microsoft SDKs. If you want to avoid the hassle of downloading and installing SDK just because of this, easy download links for all 32b/64b platforms are available at http://www.dependencywalker.com/

在 Visual Studio 之外,您可以使用能够检查 DLL 和 EXE 导入和导出的依赖项工具,它与 shell 集成并且非常易于使用。它带有一些 Microsoft SDK。如果您想避免因此而下载和安装 SDK 的麻烦,可在http://www.dependencywalker.com/上找到适用于所有 32b/64b 平台的简单下载链接

Microsoft documentation (no download) is available at MicroSoft Technet

Microsoft 文档(无需下载)可从MicroSoft Technet 获得

Similar functionality is also available in SysInternals Process Explorer - best suited when inspecting running processes.

SysInternals Process Explorer 中也提供了类似的功能 - 最适合检查正在运行的进程。

回答by Suma

If you have limited options to download: In Visual Studio you could use Visual Studio Developer Command Prompt. Open it from windows menu -> All programs -> Visual Studio XX -> Visual Studio Tools -> Developer Command Prompt. Then: run command: ildasm

如果您的下载选项有​​限:在 Visual Studio 中,您可以使用 Visual Studio 开发人员命令提示符。从 Windows 菜单 -> 所有程序 -> Visual Studio XX -> Visual Studio 工具 -> 开发人员命令提示符打开它。然后:运行命令:ildasm

Example ildasm:

示例ildasm

ildasm c:\MyNetAssembly.dll

If you have access to download any program you could use better options:
IlSpy
dotPeek
.net reflector
JustDecompile

如果您有权下载任何程序,您可以使用更好的选择:
IlSpy
dotPeek
.net 反射器
JustDecompile