dotnet / winforms

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

Component Designer still does not work #10458

Open 87Alex opened 9 months ago

87Alex commented 9 months ago

Environment

VS2022 17.8.0

.NET version

net6.0-windows

Did this work in a previous version of Visual Studio and/or previous .NET release?

No

Issue description

As Dennis mentioned in the https://github.com/dotnet/winforms/issues/4239 ticket, Component Designer does not work.

Just to indicate that we have been waiting for this Component Designer fix as well (for our commercial product for other .NET developers). We have a Controller class and a custom designer, a descendant of ComponentDocumentDesigner:

    [Designer("DevExpress.ExpressApp.Design.ControllerDesigner, DevExpress.ExpressApp.Design" + XafAssemblyInfo.VersionSuffix + XafAssemblyInfo.AssemblyNamePostfix, DevExpress.Utils.Design.Aliases.IRootDesigner)]
    [DesignerCategory("Component")]
    [DefaultEvent("Activated")]
#endif
    public abstract class Controller : Component, ISupportUpdate { ... }

    [ToolboxItem(false)]
    [ToolboxItemFilter("DevExpress.ExpressApp.Controller", ToolboxItemFilterType.Require)]
    [ToolboxItemFilter("", ToolboxItemFilterType.Custom)]
    public class ControllerDesigner : ComponentDocumentDesigner, IToolboxUser { ...}

Scenario .NET developers can configure Controller properties in the property grid and also drag & drop Actions from the Visual Studio Toolbox. Actions are child components within the parent Controller component. For more information, see this tutorial for .NET Framework.

The issue affects our ASP.NET Core Blazor and WinForms .NET Core/.NET 6+ developers, because the designer throws this Value cannot be null error. As a .NET component vendor, we had to disable the Controller designer for .NET Core/.NET 6+ projects completely for now + write documentation explaining these limitations + offer additional means for code generation such as code snippets. This is all not ideal experience (our .NET users do not want to write code here) and we hope that Component Designer will eventually be supported. Thank you.

Steps to reproduce

All info in the description.

Diagnostics

No response

merriemcgaw commented 9 months ago

@KlausLoeffelmann please take a look.