private void UpdateReferenceVersions(ProjectDocument project)
        {
            Console.Write("Updating reference versions... ");

            foreach (var reference in project.GetBinaryReferences())
            {
                // skip assemblies from GAC
                if (reference.IsGlobal)
                {
                    continue;
                }

                // skip remote packages
                if (!m_checker.IsLocal(reference.Name))
                {
                    continue;
                }

                // skip static packages
                if (m_checker.IsStatic(reference.Name))
                {
                    continue;
                }

                // package should be pinned to its current version
                if (m_checker.IsPinnedToCurrentVersion(reference.Name))
                {
                    continue;
                }

                // get version to use for local package
                var versionToUse = m_checker.VersionToUse(reference.Name);

                // update is not required
                if (versionToUse.Normalize() == reference.Version.Normalize())
                {
                    continue;
                }

                // update package version within project file
                reference.UpdateVersion(versionToUse);
            }

            Console.WriteLine("OK");
        }
Exemplo n.º 2
0
        private List <BinaryReference> GetProjectBinaryReferences()
        {
            var project = new ProjectDocument(Args.ProjectFile);

            return(project.GetBinaryReferences());
        }