AppDomainSetup.DisallowApplicationBaseProbing AppDomainSetup.DisallowApplicationBaseProbing AppDomainSetup.DisallowApplicationBaseProbing AppDomainSetup.DisallowApplicationBaseProbing Property


指定在搜索要加载的程序集时是否探测应用程序基路径和专用二进制路径。Specifies whether the application base path and private binary path are probed when searching for assemblies to load.

 property bool DisallowApplicationBaseProbing { bool get(); void set(bool value); };
public bool DisallowApplicationBaseProbing { get; set; }
member this.DisallowApplicationBaseProbing : bool with get, set
Public Property DisallowApplicationBaseProbing As Boolean


如果不允许探测,则为true ;否则为 falsetrue if probing is not allowed; otherwise, false. 默认值为 falseThe default is false.


如果属性为true,则忽略属性的值。ApplicationBase DisallowApplicationBaseProbingIf the DisallowApplicationBaseProbing property is true, the value of the ApplicationBase property is ignored. 也就是说,不会在ApplicationBase属性所指定的目录中探测程序集。That is, no assemblies are probed for in the directories specified by the ApplicationBase property. 此外,将忽略PrivateBinPath属性PrivateBinPathProbe和属性的值。In addition, the values of the PrivateBinPath property and the PrivateBinPathProbe property are ignored. 不会在PrivateBinPath属性所指定的目录中探测到的程序集。No assemblies are probed for in the directories specified by the PrivateBinPath property.

DisallowApplicationBaseProbing属性提供了对加载过程的附加控制层。The DisallowApplicationBaseProbing property provides an additional layer of control over the loading process. 在常规程序集加载序列中,在引发AppDomain.AssemblyResolve事件之前会探测应用程序基。In the normal assembly loading sequence, the application base is probed before the AppDomain.AssemblyResolve event is raised. 但是,某些应用程序可能需要从文档内的 OLE 复合文件,或从非全局程序集缓存中或ApplicationBasePrivateBinPath属性指定的目录中的唯一已知位置加载程序集。However, some applications might need to load assemblies from an OLE compound file within a document, or from a unique known location that is neither in the global assembly cache nor in the directories specified by the ApplicationBase and PrivateBinPath properties. 此类应用程序可DisallowApplicationBaseProbing使用属性来避免正常探测导致的延迟,并避免加载可能位于正常探测路径中的必要程序集的副本。Such applications can use the DisallowApplicationBaseProbing property to avoid the delay caused by normal probing, and to avoid loading copies of the necessary assembly that might be located in the normal probing paths.