public IVersionSpec GetConstraint(string packageId) { var reference = _installed.GetInstalledPackage(packageId); if (reference == null) { return(null); } return(CoreConverters.SafeToVerSpec(reference.VersionConstraint)); }
/// <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); }