winforms icon indicating copy to clipboard operation
winforms copied to clipboard

BinaryEditor doesn't work for PropertyGrid control in .net 6 preview.

Open xiaoyuvax opened this issue 2 years ago • 1 comments

.NET version

Version: 6.0.400-preview.22301.10 Commit: 25580ffe7a

Host (useful for support): Version: 6.0.6 Commit: 7cca709db2

.NET SDKs installed: 6.0.301 [C:\Program Files\dotnet\sdk] 6.0.400-preview.22301.10 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

not sure

Issue description

After an object is selected for PropertyGrid control to display and if user attempts to click and edit any of its Byte[] property, error message shown like below and supposed BinaryEditor not brought up:

Could not find the resource 'System.ComponentModel.Design.BinaryEditorresources" among the resources "System.Windows.Forms.Design.BorderSidesEditorresources" System.ComponentMode.Design.CollectionEditor.resources" System.Windows.Forms.Design.FormatControl.resources" System.Windows.Forms.Desiqn.LinkAreaEditorresources", System.Wingows.Forms.Desian.MaskDesignerDia og.resources" System.Wingows.Forms.Desian.ShortcutKevsEditorresources". System.SR.resources" System.Wingows.Forms.DesignStringCo ectionEditorresources". System.Windows.Forms.Design.Resources.System.ComponentMode.De sign.BinaryEditor.resources" 'System.Windows.Forms.Design.colordlg.data"... embedded in the assembly "System.Windows.Forms.Design nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with anincorrect name

Steps to reproduce

  1. Add a PropertyGrid control to ur WinForm.
  2. Set the PropertyGrid.SelectedObject to an object with Byte[] type properties.
  3. Run the Form, and click on the Byte[] type property in the PropertyGrid, u see the error message.

xiaoyuvax avatar Jun 27 '22 10:06 xiaoyuvax

Cause and workaround discussed here, waiting for future fix: https://stackoverflow.com/questions/72770925/binaryeditor-class-doesnt-work-for-propertygrid-control-in-net-6-preview?noredirect=1#comment128547943_72770925

xiaoyuvax avatar Jun 28 '22 04:06 xiaoyuvax

Note: This is a runtime not a WinForms Designer issue. We also need to check, if this repros in the Out-Of-Proc Designer, but I would guess in the Designer it works just fine.

@Olina-Zhang: Can you check that? Thanks! @merriemcgaw FYI.

KlausLoeffelmann avatar Feb 22 '23 02:02 KlausLoeffelmann

Yep, it's totally a runtime issue. We could actually take your name off of it and bring it back up to the team in triage. I just want to make sure it's on our radar 😃

merriemcgaw avatar Feb 22 '23 02:02 merriemcgaw

@Olina-Zhang: Can you check that? Thanks!

Out-Of-Proc Designer works fine, we can change the Byte[] type property successfully. image

Olina-Zhang avatar Feb 22 '23 09:02 Olina-Zhang

Can we also check a runtime-only version of the repro? That is what this particular issue is worried about - we are still using the Framework for the UI of the PropertyBrowser in VS, but have .NET for the runtime copy of the editors.

merriemcgaw avatar Feb 23 '23 01:02 merriemcgaw

Verified this issue on .NET 8.0.100 RC.2.23423.1 using attached project(BinaryEditor.zip), it was fixed. No error message shows while clicking byte[] type property in PropertyGrid. image

Eudora-Li01 avatar Aug 24 '23 07:08 Eudora-Li01

Verified this issue in Winforms main branch for .Net 9.0, it has same result as above Eudora's. Byte Array Property Editor can be displayed: image

Olina-Zhang avatar Aug 24 '23 07:08 Olina-Zhang