Skip to content

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

Closed

Description

@Sekar47

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

Activity

  1. added
    untriaged
    on Oct 15, 2024
  2. added
    area-VSDesigner
    on Oct 15, 2024
  3. Tanya-Solyanik commented on Oct 21, 2024

    @Tanya-Solyanik
    Contributor

    Sample project references the designer SDK

  4. Tanya-Solyanik commented on Oct 21, 2024

    @Tanya-Solyanik
    Contributor

    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/

  5. removed
    untriaged
    on Oct 31, 2024
  6. SekarSivalingam commented on Nov 22, 2024

    @SekarSivalingam

    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?

  7. locked and limited conversation to collaborators on Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-VSDesigner

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions