Skip to content

Commit

Permalink
Merge pull request #46393 from ryzngard/issue/46192_nre_save_rename
Browse files Browse the repository at this point in the history
Check `Saved` on ProjectItem before calling Save
  • Loading branch information
msftbot[bot] committed Jul 29, 2020
2 parents e449c55 + 9d94cd9 commit f364b63
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,14 @@ protected override void ApplyDocumentInfoChanged(DocumentId documentId, Document
}

// Must save the document first for things like Breakpoints to be preserved.
projectItemForDocument.Save();
// WORKAROUND: Check if the document needs to be saved before calling save.
// Should remove the if below and just call save() once
// https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1163405
// is fixed
if (!projectItemForDocument.Saved)
{
projectItemForDocument.Save();
}

var uniqueName = projectItemForDocument.Collection
.GetUniqueNameIgnoringProjectItem(
Expand Down

0 comments on commit f364b63

Please sign in to comment.