Adding two or more files based on any X# item template that lists a block (Form, Class, UserControl, WPF items, etc.) to the same SDK-style (.NET Core) project can freeze Visual Studio permanently.
To Reproduce
- Create any SDK-style (.NET Core) X# WinForms/console project.
- Add New Item -> a second file of any template that lists
(e.g. a second Class, or a second Form).
- Add a third such item, or do anything else that needs to enumerate the
References/Dependencies node -- IDE freezes.
Diagnosed via live debugger attach: a reference node's own nextSibling
field pointed back to itself.
Fix:
guard HierarchyNode.AddChild against ever re-linking a node that's already a member of the target children list.
Adding two or more files based on any X# item template that lists a block (Form, Class, UserControl, WPF items, etc.) to the same SDK-style (.NET Core) project can freeze Visual Studio permanently.
To Reproduce
(e.g. a second Class, or a second Form).
References/Dependencies node -- IDE freezes.
Diagnosed via live debugger attach: a reference node's own nextSibling
field pointed back to itself.
Fix:
guard HierarchyNode.AddChild against ever re-linking a node that's already a member of the target children list.