按照什么顺序位置搜索以加载引用的DLL? [英] In what order are locations searched to load referenced DLLs?

查看:228
本文介绍了按照什么顺序位置搜索以加载引用的DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,.NET框架查找引用的DLL文件在多个地点

I know that the .NET framework looks for referenced DLLs in several locations

  • 全局程序集缓存(GAC)
  • 在任何私有路径添加到应用程序域
  • 执行的程序集的当前目录

在这些位置搜索什么命令?就是寻找一个DLL停止,如果找到匹配或是否继续通过所有位置(如果是的话,如何解决冲突)?

What order are those locations searched? Is the search for a DLL ceased if a match is found or does it continue through all locations (and if so, how are conflicts resolved)?

另外,请证实或否认这些地点,并提供我都没有提到任何其他地方。

推荐答案

组件加载是一个相当复杂的过程,取决于许多不同的因素,如配置文件,发行策略,应用程序域设置,CLR主机,部分或全部组件名,等等。

Assembly loading is a rather elaborate process which depends on lots of different factors like configuration files, publisher policies, appdomain settings, CLR hosts, partial or full assembly names, etc.

简单的版本是,GAC是第一个,那么私有路径。 %PATH%从未使用过。

The simple version is that the GAC is first, then the private paths. %PATH% is never used.

最好是使用集绑定日志查看器(Fuslogvw.exe)调试任何组件加载的问题。

It is best to use Assembly Binding Log Viewer (Fuslogvw.exe) to debug any assembly loading problems.

修改 <一href="http://msdn.microsoft.com/en-us/library/aa720133.aspx">http://msdn.microsoft.com/en-us/library/aa720133.aspx更详细地解释这个过程。

EDIT http://msdn.microsoft.com/en-us/library/aa720133.aspx explains the process in more detail.

这篇关于按照什么顺序位置搜索以加载引用的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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