public void ProjectFinishedGenerating(Project project) { // grab reference of project since we need it this._currentProject = project; // if this isn't a stub, go and grab the NuGet packages if (!this._sitecoreConfiguration.IsStub) { using (var serviceProvider = new ServiceProvider((IServiceProvider)project.DTE)) { var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel)); IVsPackageInstaller2 installer = componentModel.GetService <IVsPackageInstaller2>(); foreach (var package in this._sitecoreConfiguration.NuGetConfiguration.Packages) { installer.InstallPackage(null, project, package.Name, package.Version, false); } } } }
public void InstallPackage(string source, EnvDTE.Project project, string packageId, string version, bool ignoreDependencies) => _packageInstaller.InstallPackage(source, project, packageId, version, ignoreDependencies);
private void UpdatePackage(Project project, PackageModel newPkg, bool includeDependencies, string pkgSrc) { _PkgInstaller.InstallPackage(pkgSrc, project, newPkg.Id, newPkg.Version, !includeDependencies); }