在.NET文件夹中搜索层次结构是什么? [英] What is the .NET folder search hierarchy?

查看:105
本文介绍了在.NET文件夹中搜索层次结构是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.NET需要加载程序集,什么是它使用搜索组件中的文件夹层次?我想这与GAC启动,并且执行的程序集的然后本地文件夹?完整的层次结构是什么?我知道Windows的搜索路径(对于非托管code)是像本地文件夹/ System32文件夹/搜索路径/等。我正在寻找类似的.NET的东西。

When .NET needs to load an assembly, what is the folder hierarchy that it uses to search for the assembly? I assume it starts with the GAC, and then local folder of the executing assembly? What is the complete hierarchy? I know the Windows search path (for unmanaged code) is something like local folder/System32 folder/search path/etc. and I am looking for something similar for .NET.

推荐答案

如果你正在寻找的过程的描述,而不是链接到漫长的MSDN文章,这是对步骤的小结 。你可以在这里找到详情

If you were looking for a description of the process rather than links to lengthy MSDN articles, this is a brief summary of the steps. You can find more details here.

步骤运行如下解析程序集引用:

Steps the runtime follows to resolve an assembly reference:

  1. 通过审查适用的配置文件确定正确的程序集的版本。
  2. 检查程序集名称是否已绑定到之前,如果是这样,使用的 previously加载的程序集
  3. 检查广汽
  4. 按照以下步骤探头的装配:

  1. Determines the correct assembly version by examining applicable configuration files.
  2. Checks whether the assembly name has been bound to before and, if so, uses the previously loaded assembly.
  3. Checks the GAC.
  4. Probes for the assembly by following these steps:

a)如果配置和发行政策不影响原来的基准,如果使用Assembly.LoadFrom方法创建绑定请求,运行时检查位置提示

a) If configuration and publisher policy do not affect the original reference and if the bind request was created using the Assembly.LoadFrom method, the runtime checks for location hints.

b)如 codeBase的在配置文件中发现,在运行时只检查这个位置。

b) If a codebase is found in the configuration files, the runtime checks only this location.

C)探头使用在描述的启发式栏目的程序集探测。如果探测后,没有发现该组件,运行时要求Windows安装程序向大会。这作为一个安装点播功能。

c) Probes for the assembly using the heuristics described in the probing section. If the assembly is not found after probing, the runtime requests the Windows Installer to provide the assembly. This acts as an install-on-demand feature.

这篇关于在.NET文件夹中搜索层次结构是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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