dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

VS is not responding after adding a user control that with events handling to the Form designer #10677

Closed SimonZhao888 closed 9 months ago

SimonZhao888 commented 10 months ago

.NET version

9.0.100-alpha.1.24066.10

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

VS is not responding after adding a user control that with events handling to the Form designer. 84885709-fee9c300-b0c5-11ea-986c-1c4ae0352f57

Steps to reproduce

  1. Create a Winforms core project.
  2. Add a User Control to the same project.
  3. Generate the UserControl1_Load event with following code: MessageBox.Show("Not Responding");
  4. Build and reopen the Form designer.
  5. Drag the user control to the Form designer.

Or

  1. Open the attached project. NotResponding.zip
  2. Build and Drag the user control to the Form designer.
SimonZhao888 commented 10 months ago

Tanya provides a solution at: https://github.com/microsoft/winforms-designer/issues/1995#issuecomment-1890223773

MandiMan commented 9 months ago

Verified this issue on .NET 9.0.100-preview.2.24107.18 with dlls built from winforms repo of main branch, the issue has been fixed. No MessageBox pop up when adding a user control with events handing to the Form designer.

https://github.com/dotnet/winforms/assets/108860782/0991ff93-0e24-40ba-b38e-3438d331c28a

Zheng-Li01 commented 8 months ago

Verified with .NET SDK 9.0.100-preview.2.24129.7 test pass build, this issue was fixed. Test result is same as above.