public virtual Task <Assembly> LoadAsync(IPluginLoadContext pluginLoadContext) { var loadContext = new DefaultAssemblyLoadContext <T>( this.logger, this.options, this.hostFrameworkProvider, this.hostTypesProvider, this.downgradableDependenciesProvider, this.remoteTypesProvider, this.dependencyPathProvider, this.probingPathsProvider, this.runtimePlatformContext, this.depsFileProvider, this.pluginDependencyResolver, this.nativeAssemblyUnloader, this.assemblyLoadStrategyProvider ); var loadedPluginKey = new LoadedPluginKey(pluginLoadContext); this.loadContexts[loadedPluginKey] = loadContext; this.loadContextReferences[loadedPluginKey] = new System.WeakReference(loadContext); return(loadContext.LoadPluginAssemblyAsync(pluginLoadContext)); }
public virtual Assembly Load(IPluginLoadContext pluginLoadContext) { var pluginAssemblyName = Path.GetFileNameWithoutExtension(pluginLoadContext.PluginAssemblyName); var loadContext = new DefaultAssemblyLoadContext <T>( this.logger, this.options, this.hostFrameworkProvider, this.hostTypesProvider, this.remoteTypesProvider, this.dependencyPathProvider, this.probingPathsProvider, this.runtimePlatformContext, this.depsFileProvider, this.pluginDependencyResolver, this.nativeAssemblyUnloader, this.assemblyLoadStrategyProvider ); this.loadContexts[pluginAssemblyName] = loadContext; this.loadContextReferences[pluginAssemblyName] = new System.WeakReference(loadContext); return(loadContext.LoadPluginAssembly(pluginLoadContext)); }