如何确定.NET应用程序的依赖关系? [英] How do I determine the dependencies of a .NET application?

查看:104
本文介绍了如何确定.NET应用程序的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确定.NET应用程序的依赖关系? Dependency Walker 可与托管应用配合使用吗?我已经下载了最新的并尝试对该应用进行了分析,但是它没有太多的解释就退出了。如果它不适用于.NET,那么还有其他一些工具可以帮助我调试运行时DLL加载问题?

How do I determine the dependencies of a .NET application? Does Dependency Walker work with managed apps? I've downloaded the latest and tried profiling the app, but it just exits without much of an explanation. If it doesn't work with .NET, then is there some other tool that would help me debug a run-time DLL loading issue?

推荐答案

依赖性助行器适用于正常的win32二进制文件。所有.NET dll和exe都有一个小的存根标题部分,使它们看起来像正常的二进制文件,但它基本上都是加载CLR - 所以这就是所有依赖关系的人会告诉你的。

Dependency walker works on normal win32 binaries. All .NET dll's and exe's have a small stub header part which makes them look like normal binaries, but all it basically says is "load the CLR" - so that's all that dependency walker will tell you.

要查看您的.NET应用程序实际依赖的内容,您可以使用非常出色的。NET反射器从红门。

To see which things your .NET app actually relies on, you can use the tremendously excellent .NET reflector from red gate.

将您的DLL加载到其中,右键单击并选择分析 - 然后您会看到取决于项目,它将显示您需要的所有其他dll(和这些dll中的方法)。

Load your DLL into it, right click, and chose 'Analyze' - you'll then see a "Depends On" item which will show you all the other dll's (and methods inside those dll's) that it needs.

有时可能会更棘手,在您的应用程序取决于X dll,X dll存在,但无论何种原因都无法加载或位于运行时。

It can sometimes get trickier though, in that your app depends on X dll, and X dll is present, but for whatever reason can't be loaded or located at runtime.

为了解决这些问题,Microsoft有装配绑定日志查看器可以在运行时显示

To troubleshoot those kinds of issues, Microsoft have an Assembly Binding Log Viewer which can show you what's going on at runtime

这篇关于如何确定.NET应用程序的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆