示例#1
0
        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);
        }
示例#2
0
        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);
        }