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
Visual Studio Crashes on Drag-and-Drop from Custom Dialog to Container in WinForms .NET Core Application #12326
Edition - Windows 11 Enterprise
Version - 23H2
OS build - 22631.3737
Visual Studio version - 17.10.4
.NET version
.NET Core 60 ,80
Did this work in a previous version of Visual Studio and/or previous .NET release?
it doesn't work on previous NetCore versions.
Issue description
I'm experiencing a crash in Visual Studio when attempting to drag a control type from a custom dialog to a container control in a WinForms .NET Core application. The drag-and-drop functionality is implemented, but Visual Studio becomes unresponsive and eventually crashes.Custom-Sample.zip
Steps to reproduce
1.Extract and Open the Attached Sample: Download and extract the provided sample project.
2.Open Form1 in Design View: Launch the project and open Form1 in the Visual Studio Designer.
3.Access the Smart Tag: Click on the smart tag option of the custom container control.
4.Open the Add Control Dialog: Click on the "Add Control" option; a dialog box should open displaying four control types.
5.Attempt to Drag and Drop: Try to drag any one of the controls from the dialog and drop it into the container on the Form1 window.
6.Observe the Crash: Note that Visual Studio crashes during the drag-and-drop operation.
Thank you for clarifying the limitation with the DesignToolsServer process. Is there any alternative approach to achieve drag-and-drop functionality from a custom dialog into a container control in a WinForms .NET Core application while adhering to the supported framework?
Activity
Tanya-Solyanik commentedon Oct 21, 2024
Sample project references the designer SDK
Tanya-Solyanik commentedon Oct 21, 2024
The AddControl designer action attempts to open a dialog in the DesignToolsServer process. Winforms Designer does not support direct UI interactions from the server process. All UI should be opened in the VisualStudio process.
https://devblogs.microsoft.com/dotnet/custom-controls-for-winforms-out-of-process-designer/
SekarSivalingam commentedon Nov 22, 2024
Hi @Tanya-Solyanik ,
Thank you for clarifying the limitation with the DesignToolsServer process. Is there any alternative approach to achieve drag-and-drop functionality from a custom dialog into a container control in a WinForms .NET Core application while adhering to the supported framework?