Пример #1
0
        public static void InstallBuildPackagingNuGetPackage(IEnumerable <Project> projects)
        {
            string packagesFolder   = GetPackagesFolder();
            var    packageReference = new PackageManagementPackageReference("NuGet.Build.Packaging", "0.1.157-dev");

            var packageReferences = new [] { packageReference };

            var projectOperations = PackageManagementServices.ProjectOperations as PackageManagementProjectOperations;

            var actions = new List <INuGetPackageAction> ();

            foreach (Project project in projects)
            {
                actions.AddRange(projectOperations.CreateInstallActions(packagesFolder, project, packageReferences));
            }

            var message = ProgressMonitorStatusMessageFactory.CreateInstallingProjectTemplatePackagesMessage();

            PackageManagementServices.BackgroundPackageActionRunner.Run(message, actions);
        }