public async Task Initialize() { var nuGetDownloader = new NuGetDownloader(_options.LoggerFactory()); var packages = await nuGetDownloader.SearchPackagesAsync(_packageFeed, _searchTerm, maxResults : _maxPackages); foreach (var packageAndRepo in packages) { var packageCatalog = new NugetPackagePluginCatalog(packageAndRepo.Package.Identity.Id, packageAndRepo.Package.Identity.Version.ToString(), _includePrereleases, _packageFeed, PackagesFolder, criterias: _typeFinderCriterias); await packageCatalog.Initialize(); _pluginCatalogs.Add(packageCatalog); } IsInitialized = true; }
public async Task Initialize() { var nuGetDownloader = new NuGetDownloader(_options.LoggerFactory()); var nugetDownloadResult = await nuGetDownloader.DownloadAsync(PackagesFolder, _packageName, _packageVersion, _includePrerelease, _packageFeed, includeSecondaryRepositories : _options.IncludeSystemFeedsAsSecondary, targetFramework : _options.TargetFramework).ConfigureAwait(false); foreach (var f in nugetDownloadResult.PackageAssemblyFiles) { _pluginAssemblyFilePaths.Add(Path.Combine(PackagesFolder, f)); } foreach (var pluginAssemblyFilePath in _pluginAssemblyFilePaths) { var options = new AssemblyPluginCatalogOptions { TypeFinderOptions = _options.TypeFinderOptions, PluginNameOptions = _options.PluginNameOptions }; var downloadedRuntimeDlls = nugetDownloadResult.RunTimeDlls.Where(x => x.IsRecommended).ToList(); var runtimeAssemblyHints = new List <RuntimeAssemblyHint>(); foreach (var runTimeDll in downloadedRuntimeDlls) { var runtimeAssembly = new RuntimeAssemblyHint(runTimeDll.FileName, runTimeDll.FullFilePath, runTimeDll.IsNative); runtimeAssemblyHints.Add(runtimeAssembly); } options.PluginLoadContextOptions.RuntimeAssemblyHints = runtimeAssemblyHints; var assemblyCatalog = new AssemblyPluginCatalog(pluginAssemblyFilePath, options); await assemblyCatalog.Initialize(); _pluginCatalogs.Add(assemblyCatalog); } IsInitialized = true; }
public async Task Initialize() { var nuGetDownloader = new NuGetDownloader(_options.LoggerFactory()); var pluginAssemblyFileNames = await nuGetDownloader.DownloadAsync(PackagesFolder, _packageName, _packageVersion, _includePrerelease, _packageFeed); foreach (var f in pluginAssemblyFileNames) { _pluginAssemblyFilePaths.Add(Path.Combine(PackagesFolder, f)); } foreach (var pluginAssemblyFilePath in _pluginAssemblyFilePaths) { var options = new AssemblyPluginCatalogOptions { TypeFinderOptions = _options.TypeFinderOptions, PluginNameOptions = _options.PluginNameOptions }; var assemblyCatalog = new AssemblyPluginCatalog(pluginAssemblyFilePath, options); await assemblyCatalog.Initialize(); _pluginCatalogs.Add(assemblyCatalog); } IsInitialized = true; }