You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In Designer, Nesting a TreeView in a UserControl in a second TabPage on a Form hangs DesignServerTools.exe #4336
Apologies if this is not the right repo to post this in.
[Edit: I found instruction to send feedback using the VS Feedback tool in Visual Studio and I have done so, please close this issue here if it is not appropriate for this repo.]
.NET Core Version:
Microsoft.NETCore.App 5.0.0
Microsoft.WindowsDesktop.App 5.0.0
SDK 5.0.100
Visual Studio Community Version 16.8.2
Have you experienced this same bug with .NET Framework?:
No
Problem description:
In the designer, upon activating a second tab page containing a User Control with a TreeView in it, VS hangs.
Expected behavior:
Visual Studio does not hang and the designer continues to work normally.
This project was created with the following steps:
Create a Windows Form App (.NET) project.
Open Form1 in the designer.
Add a TabControl and keep the two tabs.
Add a User Control to the project. Open it in design mode.
Add a TreeView to the User Control and build the project to compile it.
Add the User Control to the second TabPage on the Form.
Save form.
Switch to the first TabPage and then back to the second and the hang should occur.
Upon recovering, simply reopen the form and switch to the second TabPage to cause the hang again (assuming the save went through).
If using the attached project, build before opening the form (hang does not happen until build is made and designer reopened).
You may also need to rebuild in that VS session, or with the designer open. I am seeing inconsistent behavior where the designer does not show the User Control at all after I open the project in a fresh session of VS.
These variants of the project do NOT produce any hangs or other undesirable behavior:
UserControl does not contain TreeView
TreeView directly on TabPage without user control
UserControl with TreeView on first TabPage (at least, having it visible when the form loads does not hang)
I attempted to debug both VS and DesignServerTools but I am not sure exactly what I am looking at.
VS' UI thread seems to hang waiting for a response from the DesignServerTools for a Hit Test on the designer or a control or something.
One of the DesignServerTools threads that stuck out to me seems to get struck calling the native SetFocus WinAPI whenever I happened to pause it. It seems to call it but the call never completes if I try to step over it.
Killing the DesignServerTools process tends to allow VS to recover so I believe the problem lies with DesignServerTools.
changed the title [-]Nesting a TreeView in a UserControl in a second TabPage on a Form hangs DesignServerTools.exe[/-][+]In Designer, Nesting a TreeView in a UserControl in a second TabPage on a Form hangs DesignServerTools.exe[/+]on Dec 8, 2020
Failed to repro the issue following the steps based on The-MAZZTer's description, however reproduce the issue after click "Add Tab"/"Remove Tab". see below repro GIF.
in addition, there have a similar known 2632 issue in Design repo to track it.
On my Developer Community thread a similar known issue was posted. I reproduced and debugged it and it appears very similar to what I am seeing in my issue, so it is likely the same problem.
Activity
[-]Nesting a TreeView in a UserControl in a second TabPage on a Form hangs DesignServerTools.exe[/-][+]In Designer, Nesting a TreeView in a UserControl in a second TabPage on a Form hangs DesignServerTools.exe[/+]Zheng-Li01 commentedon Dec 8, 2020
Failed to repro the issue following the steps based on The-MAZZTer's description, however reproduce the issue after click "Add Tab"/"Remove Tab". see below repro GIF.

in addition, there have a similar known 2632 issue in Design repo to track it.
The-MAZZTer commentedon Dec 8, 2020
On my Developer Community thread a similar known issue was posted. I reproduced and debugged it and it appears very similar to what I am seeing in my issue, so it is likely the same problem.
https://developercommunity2.visualstudio.com/t/Nesting-a-TreeView-in-a-UserControl-in-a/1280521
RussKie commentedon Dec 8, 2020
Thank you. The issue is being tracked in the designer repo, and it is expected to be fixed in 16.9.
RussKie commentedon Feb 21, 2022
@Zheng-Li01 can you please if this still repros? If not - please close.
Cassie-Li01 commentedon Apr 7, 2022
The issue can repro on version 17.2.0 Preview 2.1 download from: https://visualstudio.microsoft.com/vs/preview/
repro steps:
in addition, there is a similar known issue https://github.com/dotnet/winforms-designer/issues/2632 in Design repo to track it.
JeremyKuhne commentedon Apr 19, 2023
Note that #9002 may be the same root issue
Tanya-Solyanik commentedon Oct 25, 2024
This is a duplicate of https://github.com/microsoft/winforms-designer/issues/2632, closing, we'll update this issue when we make progress on the internal issue.