public async Task UninstallPackageAsync(CancellationToken token) { var actions = await PreviewUninstallPackageAsync(token); await packageManager.ExecuteNuGetProjectActionsAsync( nugetProject, actions, projectContext, NullSourceCacheContext.Instance, token ).ConfigureAwait(false); }
public async Task InstallPackageAsync(CancellationToken token) { using (var sourceCacheContext = new SourceCacheContext()) { var actions = await PreviewInstallPackage(sourceCacheContext, token); if (!actions.Any()) { return; } NuGetPackageManager.SetDirectInstall(identity, projectContext); await packageManager.ExecuteNuGetProjectActionsAsync( nugetProject, actions, projectContext, sourceCacheContext, token); NuGetPackageManager.ClearDirectInstall(projectContext); } }