Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio Crashes on Drag-and-Drop from Custom Dialog to Container in WinForms .NET Core Application #12326

Closed
Sekar47 opened this issue Oct 15, 2024 · 3 comments
Assignees
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues

Comments

@Sekar47
Copy link

Sekar47 commented Oct 15, 2024

Environment

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.

Diagnostics

No response

@Sekar47 Sekar47 added the untriaged The team needs to look at this issue in the next triage label Oct 15, 2024
@JeremyKuhne JeremyKuhne added the area-VSDesigner Windows Forms out-of-proc designer related issues label Oct 15, 2024
@Tanya-Solyanik
Copy link
Member

Sample project references the designer SDK

@Tanya-Solyanik
Copy link
Member

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/

@dotnet-policy-service dotnet-policy-service bot removed the untriaged The team needs to look at this issue in the next triage label Oct 31, 2024
@SekarSivalingam
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues
Projects
None yet
Development

No branches or pull requests

6 participants