We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 24eabd0 + 2876142 commit d3666d9Copy full SHA for d3666d9
src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/UI/InfoBars/VsInfoBarService.cs
@@ -47,7 +47,10 @@ public VsInfoBarService(
47
{
48
lock (s_entries)
49
50
- foreach (InfoBar entry in s_entries)
+ // Copy the list to avoid "collection modified during enumeration" exceptions,
51
+ // as when the last project associated with an info bar is closed, we will
52
+ // remove that entry from the list.
53
+ foreach (InfoBar entry in s_entries.ToList())
54
55
entry.OnProjectClosed(_project);
56
}
0 commit comments