AssemblyDependencyResolver 类
定义
允许程序根据给定程序集的依赖关系将程序集和本机库解析为路径。Allows a program to resolve assemblies and native libraries to paths based on the dependencies of a given assembly.
public ref class AssemblyDependencyResolver sealed
public sealed class AssemblyDependencyResolver
type AssemblyDependencyResolver = class
Public NotInheritable Class AssemblyDependencyResolver
- 继承
-
AssemblyDependencyResolver
注解
AssemblyDependencyResolver通过类,应用程序开发人员可以更轻松地与自定义实例一起开发插件体系结构, System.Runtime.Loader.AssemblyLoadContext 以便隔离插件,还可以启用插件来加载依赖项。The AssemblyDependencyResolver class enables application developers to more easily develop a plugin architecture in conjunction with custom System.Runtime.Loader.AssemblyLoadContext instances to isolate plugins and also enable plugins to load dependencies.
有关使用插件创建 .Net Core 应用程序的教程介绍了如何创建一个自定义 AssemblyLoadContext ,该自定义使用 AssemblyDependencyResolver 来解析插件的依赖项,并正确地将插件的依赖项与宿主应用程序隔离开来。The tutorial on creating a .NET Core application with plugins describes how to create a custom AssemblyLoadContext that uses an AssemblyDependencyResolver to resolve the dependencies of the plugin and correctly isolate the plugin's dependencies from the hosting application.
构造函数
| AssemblyDependencyResolver(String) |
使用组件的程序集的路径初始化 AssemblyDependencyResolver 类的新实例。Initializes a new instance of the AssemblyDependencyResolver class with a path to a component's assembly. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ResolveAssemblyToPath(AssemblyName) |
基于组件的依赖关系解析具有给定程序集名称的程序集的路径。Resolves a path to an assembly with the given assembly name based on the component's dependencies. |
| ResolveUnmanagedDllToPath(String) |
基于组件的依赖关系解析具有给定名称的本机库的路径。Resolves a path to a native library with the given name based on the component's dependencies. |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |