async Task ExecuteAsync(CancellationToken cancellationToken) { if (!IsErrorWhenPackageNotInstalled) { bool installed = await IsPackageInstalled(cancellationToken); if (!installed) { ReportPackageNotInstalled(); return; } } actions = await packageManager.PreviewUninstallPackageAsync( project, PackageId, CreateUninstallationContext(), context, cancellationToken); project.OnBeforeUninstall(actions); await packageManager.ExecuteNuGetProjectActionsAsync( project, actions, context, NullSourceCacheContext.Instance, cancellationToken); project.OnAfterExecuteActions(actions); await project.RunPostProcessAsync(context, cancellationToken); }
async Task ExecuteAsync(CancellationToken cancellationToken) { actions = await packageManager.PreviewUninstallPackageAsync( project, PackageId, CreateUninstallationContext(), context, cancellationToken); project.OnBeforeUninstall(actions); await packageManager.ExecuteNuGetProjectActionsAsync( project, actions, context, cancellationToken); project.OnAfterExecuteActions(actions); await project.RunPostProcessAsync(context, cancellationToken); }