Skip to content

Scenario where DesignMode is false from the NET WinForms OOP designer #7424

Description

@tracktownsoftware

Description

When using my NET6 Windows Forms custom control to display a dialog at design time, the DesignMode value is incorrectly false even though it is running in the DesignToolsServer process.

Reproduction Steps

My github sample to reproduce:
https://github.com/tracktownsoftware/MicrosoftWinFormsDesignerSDK_DesignModeBug

The above repository includes a Nuget package you can use to test and reproduce. The nuget package contains a custom NET6 WinForms "MyButton" control with WinForms Designer Extensibility SDK design-time support.

Expected behavior

DesignMode should be true because it is running in the DesignToolsServer process.

Actual behavior

DesignMode is false.

See https://github.com/tracktownsoftware/MicrosoftWinFormsDesignerSDK_DesignModeBug/blob/main/README.md

Regression?

No response

Known Workarounds

Rather than using DesignMode check for System.Diagnostics.Process.GetCurrentProcess().ProcessName=="DesignToolsServer"

Configuration

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions