您如何知道您的C#应用​​程序正在使用哪个dll? [英] How do you tell which dll your c# application is using?

查看:66
本文介绍了您如何知道您的C#应用​​程序正在使用哪个dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用.dll的应用程序,该文件在位置x中充满了gui应用程序代码。它曾经有1个按钮,但是现在有2个按钮。

I have an application which uses a .dll which is full of gui application code in location x. It use to have 1 button in, but now has 2.

当我启动我的应用程序时,我希望看到的是带有2个按钮的gui,但是我看到一个gui有1个按钮。我已经重建了gui .dll,但是从某个地方神奇地使用了旧版本。如果我尝试调试我的代码,它说我正在使用的代码版本与.dll中的版本不同。

When i start my application what i expect to see is a gui with 2 buttons, however i see a gui with 1 button. i have rebuild my gui .dll but it is magically using an older version from somewhere. If i try and debug my code it says that the version of code i am using is different from the one in the .dll

我的问题是,我如何找到出它正在寻找.dll的位置,为什么会使用旧版本,因为我只有一个地方可以编译.dll?

My question is, "How can i find out where it is looking for the .dll and why would it be using an old version as i only have 1 place where i compile the .dll to?"

声明我已引用它,并且它是具有2个按钮的正确版本。但是当我运行它时,它正在使用另一个版本???

Also wanted to state that i have it referenced and it is the correct version which has the 2 buttons in.. but when i run it is using another version???

推荐答案

如果使用的是Visual Studio,请打开模块窗口,依次单击调试-> Windows->模块(Ctrl-D + M),这将列出所有已加载的程序集。

If you are using Visual Studio open the Modules window, Debug->Windows->Modules (Ctrl-D+M) and this will list all loaded assemblies.

您还可以在运行时使用AppDomain.CurrentDomain.GetAssemblies()并在列表中查找每个Assembly.CodeBase。

You can also at run time use AppDomain.CurrentDomain.GetAssemblies() and walk the list looking at each Assembly.CodeBase.

如果其他所有方法均失败您还可以从sysinternals http://technet.microsoft.com/zh-cn/ sysinternals / bb89664 5 并观察您的进程加载了哪些dll,但是您将过滤掉大量的输出。

If all else fails you can also use ProcessMonitor from sysinternals http://technet.microsoft.com/en-us/sysinternals/bb896645 and watch which dlls are loaded by your process, but you'll be filtering out tons of output.

这篇关于您如何知道您的C#应用​​程序正在使用哪个dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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