private static void InstallLatestNugetPackage(IProject project, IVsPackageInstallerServices vsPackageInstallerServices, IVsPackageInstaller vsPackageInstaller, string packageName)
        {
            vsPackageInstaller.InstallPackage("All",
                                              project.As <EnvDTE.Project>(),
                                              packageName,
                                              (Version)null,
                                              false);

            // Call the installed packages to get the version that was just installed and cache the version.
            var installedPackages = vsPackageInstallerServices.GetInstalledPackages();

            NugetPackageVersionManager.UpdateCache(packageName, installedPackages);
        }
        private static void InstallLatestNugetPackage(IProject project, IVsPackageInstallerServices vsPackageInstallerServices, IVsPackageInstaller vsPackageInstaller, string packageId, int?majorVersion)
        {
            // lookup latest version for the given major (or null), and install that
            var latestVersion = GetLatestVersionForMajor(packageId, majorVersion);

            vsPackageInstaller.InstallPackage(
                ServiceMatrixOverrides.GetNugetFeedServiceBaseAddress() ?? "All",
                project.As <EnvDTE.Project>(),
                packageId,
                latestVersion,
                false);

            // Call the installed packages to get the version that was just installed and cache the version.
            // Packages are needed in case latestVersion is null,
            var installedPackages = vsPackageInstallerServices.GetInstalledPackages();

            NugetPackageVersionManager.UpdateCache(packageId, majorVersion, installedPackages);
        }