コード例 #1
0
        public IVersionSpec GetConstraint(string packageId)
        {
            var reference = _installed.GetInstalledPackage(packageId);

            if (reference == null)
            {
                return(null);
            }
            return(CoreConverters.SafeToVerSpec(reference.VersionConstraint));
        }
コード例 #2
0
        /// <summary>
        /// Get Installed Package References a single project with specified packageId
        /// </summary>
        /// <returns></returns>
        protected InstalledPackageReference GetInstalledReference(VsProject proj, string Id)
        {
            InstalledPackageReference packageRef    = null;
            InstalledPackagesList     installedList = proj.InstalledPackages;

            if (installedList != null)
            {
                packageRef = installedList.GetInstalledPackage(Id);
            }
            return(packageRef);
        }