C1DashboardLayout samples: designer does not work in .NET 8

Posted by: wknauf on 21 August 2024, 6:52 am EST

  • Posted 21 August 2024, 6:52 am EST - Updated 21 August 2024, 6:57 am EST

    Hi C1,

    doing my first steps in C1Dashboard and took a look at the samples. It seems there is a winforms designer problem with .NET8. It is reproducible with e.g. “ComponentOne Samples\WinForms\v8.0\DashboardLayout\CS\DashboardLayoutExplorer\Samples\Overview.cs” or “ComponentOne Samples\WinForms\v8.0\DashboardLayout\CS\DashboardLayoutDemo\MainForm.cs”. Both report this error when opening them in designer (VS 17.11.1):

    "Type 'System.Drawing.Printing.PageSettings' in Assembly 'System.Drawing.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' is not marked as serializable"

    This makes it harder to understand how to build a dashboard layout. But we have to do it by code anyway for our use case, so I think designer support is not a requirement here.

    Best regards

    Wolfgang

  • Posted 21 August 2024, 6:53 am EST

    And the WinForms designer console prints this error:

    [12:43:45.688248] fail: Request failures: Sessions/InitializeRootComponent.
                            Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Type  could not be read from the data in line 156, position 5.  The type's internal structure may have changed.  Either implement ISerializable on the type or provide a type converter that can provide a more reliable conversion format, such as text or an array of bytes.  The conversion exception was: Type 'System.Drawing.Printing.PageSettings' in Assembly 'System.Drawing.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' is not marked as serializable. ---> Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Type  could not be read from the data in line 156, position 5.  The type's internal structure may have changed.  Either implement ISerializable on the type or provide a type converter that can provide a more reliable conversion format, such as text or an array of bytes.  The conversion exception was: Type 'System.Drawing.Printing.PageSettings' in Assembly 'System.Drawing.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' is not marked as serializable. Line 156, position 5. ---> Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Type 'System.Drawing.Printing.PageSettings' in Assembly 'System.Drawing.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' is not marked as serializable.
                               --- End of inner exception stack trace ---
                               --- End of inner exception stack trace ---
                            For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
    [12:43:45.700313] fail: Request failures: Sessions/EndLoad.
                            Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: 'Site' must not be null in order to access a required service.
                            For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
    

  • Posted 22 August 2024, 3:32 am EST

    Hello Wolfgang,

    We were also able to replicate the issue on our end. We have escalated it to the development team and will update you once the issue is fixed.

    [Internal Tracking ID: C1WIN-32824]

    You can resolve the error by removing the “c1TrueDBGrid1.PrintInfo.PageSettings” entry from the resx file of the Form. The entry looks like the following when you open the resx file with “XML (Text) Editor”:

    <data name="c1TrueDBGrid1.PrintInfo.PageSettings" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>
             ....some value
         </value>
      </data>

    Regards,

    Uttkarsh.

  • Posted 22 August 2024, 10:49 am EST - Updated 22 August 2024, 10:59 am EST

    Thanks, now I can view the samples with WinForms designer - this is quite helpful. So the issue was not related to C1DashboardLayout, but was caused by C1TrueDbGrid?

    Further experimenting with C1DashboardLayout:

    a) is it possible at all to design layout types “Flow” and “Grid” by designer, or can they be built only be code?

    When adding a System.Windows.Forms.Panel to the C1DashboardLayout, the control is added to the root form instead of being added to “c1DashboardLayout1.FlowLayoutControl.Controls”.

    b) with layout type “Split”, it seems I have to add two “C1SplitterPanel” to the root DashboardLayout. This is not possible by designer, as the toolbox contains only “C1SplitContainer”, but not the C1SplitterPanel. And there is no “SplitLayoutControl” property available in the C1DashboardLayout property grid.

    I could achieve this by typing part of the code to “InitializeComponent”, afterwards designer worked.

    c) the properties “SplitLayoutControl”, “GridLayoutControl” and “FlowLayoutControl” all have the attribute “EditorBrowsable(EditorBrowsableState.Never)”, which is quite irritating as the properties are not shown when building the layout by code.

    It seems the designer support for .NET8 is not finished for C1DashboardLayout?

    Best regards

    Wolfgang

  • Posted 23 August 2024, 6:45 am EST

    Hello Wolfgang,

    We have shared your observations with the development team for their insights. Rest assured, we’ll update you once we have more information.

    [Internal Tracking ID: C1WIN-32832]

    Regards,

    Uttkarsh.

  • Posted 26 August 2024, 8:37 am EST

    Bonus: due to historical reasons, we set the “CLSCompliant” assembly attribute. This results in warnings if we use C1DashboardLayout in public API of our assembly:

    CS3001	Argument type 'C1DashboardLayout' is not CLS-compliant

    Is it possible to you make your assembly CLSCompliant?

    Best regards

    Wolfgang

  • Posted 27 August 2024, 2:25 am EST

    Hello Wolfgang,

    We have escalated your request to the development team and will keep you updated with the necessary information.

    [Internal tracking ID: C1WIN-32841]


    As for designing support for DashboardLayout (C1WIN-32832)-

    As per the developers, the designer for the .NET 8 DashboardLayout component was not ported yet from the .Net Framework version.

    Microsoft significantly changed the Visual Studio designer architecture for .NET 8, requiring a complete reimplementation from scratch. Because of this, it’ll take a lot of time to add the mentioned support.

    We sincerely apologize for any inconvenience caused by this. The ETA for the design support is 2025v1.

    [Feature Request ID: C1WIN-28947]

    Regards,

    Uttkarsh.

  • Posted 29 August 2024, 12:18 am EST

    Hello Wolfgang,

    For DashboardLayout sample designer error (C1WIN-32824)-

    As per the development team, the reported issue is a bug, and the ETA for the fix is 2024 v2 hotfix 2.

    [Bug tracking ID: C1WIN-32852]

    For CLSCompliant request (C1WIN-32841)-

    The development team will be fixing this issue in the 2024 v2 release. Rest assured, we’ll update you once it is available.

    [Tracking ID: C1WIN-32849]

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels