void TryGetActiveProject() { try { project = solution.GetActiveProject(); } catch (Exception ex) { errorMessage = ex.Message; } }
public void Run(PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage) { try { IPackageManagementProject project = solution.GetActiveProject(); ReinstallPackageAction action = project.CreateReinstallPackageAction(); action.PackageId = packageReferenceNode.Id; action.PackageVersion = packageReferenceNode.Version; runner.Run(progressMessage, action); } catch (Exception ex) { runner.ShowError(progressMessage, ex); } }