protected override void ProcessRecordCore() { NuGetUIThreadHelper.JoinableTaskFactory.Run(async delegate { CheckSolutionState(); var projects = new List <IVsProjectAdapter>(); // if no project specified, use default if (ProjectName == null) { var defaultProject = GetDefaultProject(); // if no default project (empty solution), throw terminating if (defaultProject == null) { ErrorHandler.ThrowNoCompatibleProjectsTerminatingError(); } projects.Add(defaultProject); } else { // get matching projects, expanding wildcards projects.AddRange(GetProjectsByName(ProjectName)); } // Create a new app domain so we don't load the assemblies into the host app domain var domain = AppDomain.CreateDomain("domain"); try { foreach (var project in projects) { var projectAssembliesCache = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase); var redirects = await RuntimeHelpers.AddBindingRedirectsAsync(VsSolutionManager, project, domain, projectAssembliesCache, _frameworkMultiTargeting, this); // Print out what we did WriteObject(redirects, enumerateCollection: true); } } finally { AppDomain.Unload(domain); } }); }