public void CheckProjectPackages (IDotNetProject project)
		{
			packageReferenceFile = CreatePackageReferenceFile (project.GetPackagesConfigFilePath ());
			packageReferences = packageReferenceFile.GetPackageReferences ().ToList ();

			var targetFramework = new ProjectTargetFramework (project);
			compatibilityReport = new ProjectPackagesCompatibilityReport (targetFramework.TargetFrameworkName);

			foreach (PackageReference packageReference in packageReferences) {
				IPackage package = packageRepository.Repository.FindPackage (packageReference.Id);
				if (package != null) {
					if (PackageNeedsReinstall (project, package, packageReference.TargetFramework)) {
						packagesRequiringReinstallation.Add (package);
					}
				}
			}
		}
		public void CheckProjectPackages (IDotNetProject project)
		{
			IPackageManagementProject packageManagementProject = solution.GetProject (registeredRepositories.ActiveRepository, project);

			packageReferenceFile = CreatePackageReferenceFile (project.GetPackagesConfigFilePath ());
			packageReferences = packageReferenceFile.GetPackageReferences ().ToList ();

			compatibilityReport = new ProjectPackagesCompatibilityReport (packageManagementProject.TargetFramework);

			foreach (PackageReference packageReference in packageReferences) {
				IPackage package = packageManagementProject.FindPackage (packageReference.Id);
				if (package != null) {
					if (PackageNeedsReinstall (project, package, packageReference.TargetFramework)) {
						packagesRequiringReinstallation.Add (package);
					}
				}
			}
		}
        public void CheckProjectPackages(IDotNetProject project)
        {
            IPackageManagementProject packageManagementProject = solution.GetProject(registeredRepositories.ActiveRepository, project);

            packageReferenceFile = CreatePackageReferenceFile(project.GetPackagesConfigFilePath());
            packageReferences    = packageReferenceFile.GetPackageReferences().ToList();

            compatibilityReport = new ProjectPackagesCompatibilityReport(packageManagementProject.TargetFramework);

            foreach (PackageReference packageReference in packageReferences)
            {
                IPackage package = packageManagementProject.FindPackage(packageReference.Id);
                if (package != null)
                {
                    if (PackageNeedsReinstall(project, package, packageReference.TargetFramework))
                    {
                        packagesRequiringReinstallation.Add(package);
                    }
                }
            }
        }
        public void CheckProjectPackages(IDotNetProject project)
        {
            packageReferenceFile = CreatePackageReferenceFile(project.GetPackagesConfigFilePath());
            packageReferences    = packageReferenceFile.GetPackageReferences().ToList();

            var targetFramework = new ProjectTargetFramework(project);

            compatibilityReport = new ProjectPackagesCompatibilityReport(targetFramework.TargetFrameworkName);

            foreach (PackageReference packageReference in packageReferences)
            {
                IPackage package = packageRepository.Repository.FindPackage(packageReference.Id);
                if (package != null)
                {
                    if (PackageNeedsReinstall(project, package, packageReference.TargetFramework))
                    {
                        packagesRequiringReinstallation.Add(package);
                    }
                }
            }
        }
Exemplo n.º 5
0
        public async Task CheckProjectPackages(IDotNetProject project)
        {
            packageReferenceFileName = project.GetPackagesConfigFilePath();

            var targetFramework = new ProjectTargetFramework(project);

            compatibilityReport = new ProjectPackagesCompatibilityReport(targetFramework.TargetFrameworkName);

            IPackageCompatibilityNuGetProject nugetProject = await GetNuGetProject(project);

            var installedPackages = await nugetProject.GetInstalledPackagesAsync(CancellationToken.None);

            packageReferences = installedPackages.ToList();

            foreach (var packageReference in packageReferences)
            {
                if (PackageNeedsReinstall(nugetProject, packageReference))
                {
                    packagesRequiringReinstallation.Add(packageReference.PackageIdentity);
                }
            }
        }