Assembly.LoadWithPartialName Assembly.LoadWithPartialName Assembly.LoadWithPartialName Assembly.LoadWithPartialName Method

定义

使用部分名称从应用程序目录或从全局程序集缓存加载程序集。Loads an assembly from the application directory or from the global assembly cache using a partial name.

重载

LoadWithPartialName(String) LoadWithPartialName(String) LoadWithPartialName(String) LoadWithPartialName(String)

使用部分名称从应用程序目录或从全局程序集缓存加载程序集。Loads an assembly from the application directory or from the global assembly cache using a partial name.

LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence)

使用部分名称从应用程序目录或从全局程序集缓存加载程序集。Loads an assembly from the application directory or from the global assembly cache using a partial name. 使用提供的证据将该程序集加载到调用方的域中。The assembly is loaded into the domain of the caller using the supplied evidence.

注解

重要

Assembly.LoadWithPartialName方法的重载已过时, 已保留以实现向后兼容性。The overloads of the Assembly.LoadWithPartialName method are obsolete and have been retained for backward compatibility. 未过时的替代项为 Assembly.Load(String)The non-obsolete alternative is Assembly.Load(String).

LoadWithPartialName(String) LoadWithPartialName(String) LoadWithPartialName(String) LoadWithPartialName(String)

警告

此 API 现已过时。

使用部分名称从应用程序目录或从全局程序集缓存加载程序集。Loads an assembly from the application directory or from the global assembly cache using a partial name.

public:
 static System::Reflection::Assembly ^ LoadWithPartialName(System::String ^ partialName);
[System.Obsolete]
[System.Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[System.Obsolete("This method has been deprecated. Please use Assembly.Load() instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Reflection.Assembly LoadWithPartialName (string partialName);
static member LoadWithPartialName : string -> System.Reflection.Assembly
Public Shared Function LoadWithPartialName (partialName As String) As Assembly

参数

partialName
String String String String

程序集的显示名称。The display name of the assembly.

返回

加载的程序集。The loaded assembly. 如果未找到 partialName,此方法将返回 nullIf partialName is not found, this method returns null.

异常

partialName 参数为 nullThe partialName parameter is null.

assemblyFile 不是有效的程序集。assemblyFile is not a valid assembly.

- 或 --or- 当前加载的是公共语言运行时 2.0 版或更高版本,而 partialName 是用更高的版本编译的。Version 2.0 or later of the common language runtime is currently loaded and partialName was compiled with a later version.

注解

重要

LoadWithPartialName(String)方法已过时, 已保留, 以实现向后兼容性。The LoadWithPartialName(String) method is obsolete and has been retained for backward compatibility. 未过时的替代项为 Assembly.Load(String)The non-obsolete alternative is Assembly.Load(String).

使用此方法加载程序集的应用程序将受到这些程序集升级的影响。Applications that load assemblies with this method will be affected by upgrades of those assemblies. 因此, 请不要使用此方法;重新设计应用程序以使用Load(String)方法重载LoadFrom(String)或方法重载。Therefore, do not use this method; redesign the application to use the Load(String) method overload or the LoadFrom(String) method overload.

此方法首先调用LoadThis method first calls Load. 如果未找到该程序集, 则此方法将从具有相同简单名称和最高版本号的全局程序集缓存返回程序集。If the assembly is not found, this method returns the assembly from the global assembly cache that has the same simple name, and the highest version number.

另请参阅

LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence) LoadWithPartialName(String, Evidence)

警告

此 API 现已过时。

使用部分名称从应用程序目录或从全局程序集缓存加载程序集。Loads an assembly from the application directory or from the global assembly cache using a partial name. 使用提供的证据将该程序集加载到调用方的域中。The assembly is loaded into the domain of the caller using the supplied evidence.

public:
 static System::Reflection::Assembly ^ LoadWithPartialName(System::String ^ partialName, System::Security::Policy::Evidence ^ securityEvidence);
[System.Obsolete]
[System.Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Reflection.Assembly LoadWithPartialName (string partialName, System.Security.Policy.Evidence securityEvidence);
static member LoadWithPartialName : string * System.Security.Policy.Evidence -> System.Reflection.Assembly
Public Shared Function LoadWithPartialName (partialName As String, securityEvidence As Evidence) As Assembly

参数

partialName
String String String String

程序集的显示名称。The display name of the assembly.

securityEvidence
Evidence Evidence Evidence Evidence

用于加载程序集的证据。Evidence for loading the assembly.

返回

加载的程序集。The loaded assembly. 如果未找到 partialName,此方法将返回 nullIf partialName is not found, this method returns null.

异常

一个程序集或模块用两个不同的证据集加载了两次。An assembly or module was loaded twice with two different sets of evidence.

partialName 参数为 nullThe partialName parameter is null.

assemblyFile 不是有效的程序集。assemblyFile is not a valid assembly.

- 或 --or- 当前加载的是公共语言运行时 2.0 版或更高版本,而 partialName 是用更高的版本编译的。Version 2.0 or later of the common language runtime is currently loaded and partialName was compiled with a later version.

注解

重要

LoadWithPartialName(String, Evidence)方法已过时, 已保留, 以实现向后兼容性。The LoadWithPartialName(String, Evidence) method is obsolete and has been retained for backward compatibility. 未过时的替代项为 Assembly.Load(String)The non-obsolete alternative is Assembly.Load(String).

证据是输入安全策略决策的一组信息(如代码可授予哪些权限)。Evidence is the set of information that constitutes input to security policy decisions, such as what permissions can be granted to code.

使用此方法加载程序集的应用程序将受到这些程序集升级的影响。Applications that load assemblies with this method will be affected by upgrades of those assemblies. 因此, 请不要使用此方法;重新设计应用程序以使用Load方法LoadFrom或方法。Therefore, do not use this method; redesign the application to use the Load method or the LoadFrom method.

此方法首先调用LoadThis method first calls Load. 如果未找到该程序集, 则此方法将从具有相同简单名称和最高版本号的全局程序集缓存返回程序集。If the assembly is not found, this method returns the assembly from the global assembly cache that has the same simple name, and the highest version number.

安全性

SecurityPermission
用于调用非托管代码和加载包含证据的程序集。for calling unmanaged code and to load an assembly with evidence. 关联的枚举:ControlEvidenceAssociated enumeration: ControlEvidence

另请参阅

适用于