public void UpdateProject (MSBuildProject project) { string importsRelativeDirectory = MSBuildProjectService.ToMSBuildPath (project.BaseDirectory, importsBaseDirectory); var importsToRemove = project.Imports.Where (import => IsMatch (import, importsRelativeDirectory)).ToList (); using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater ()) { foreach (MSBuildImport import in importsToRemove) { project.RemoveImport (import.Project); updater.RemoveImport (import.Project); updater.UpdateProject (project); } } }
public void RemoveImport(string targetFullPath) { GuiSyncDispatch(async() => { string relativeTargetPath = GetRelativePath(targetFullPath); project.RemoveImport(relativeTargetPath); RemoveImportWithForwardSlashes(targetFullPath); using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater()) { updater.RemoveImport(relativeTargetPath); await project.SaveAsync(); } packageManagementEvents.OnImportRemoved(project, relativeTargetPath); }); }
public void UpdateProject(MSBuildProject project) { string importsRelativeDirectory = MSBuildProjectService.ToMSBuildPath(project.BaseDirectory, importsBaseDirectory); var importsToRemove = project.Imports.Where(import => IsMatch(import, importsRelativeDirectory)).ToList(); using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater()) { foreach (MSBuildImport import in importsToRemove) { project.RemoveImport(import.Project); updater.RemoveImport(import.Project); updater.UpdateProject(project); } } }