Open sergey-m-pega opened 1 year ago
I am sadly running into that same issue now on .NET 8. Our application utilizes designer stack, providing for design surface and an ability to D&D controls on it. That's where we ran into an issue of missing AutoSizeToolboxItem type on some controls, Label for instance. Does anyone have any suggestions as to how to work around it? I'd appreciate it.
.NET version
.NET 7
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
.NET 4.8.1
Issue description
Our Windows based app offers Toolbox like functionality allowing user to drop controls onto WinForms design surface. In the process of doing that, .NET ToolboxItem looks at it's declared ToolboxItemAttribute. That is the attribute that still points at .NET Framework 4.8 as evident by examining components with tool like Reflector. Affected components are: Label, LinkedLabel, Checkbox and RadioButton. Here's a sample of decompiled class:
AssemblyRef is the part that points at .NET Framework 4.8. Worse yet, there is no equivalent type definition in .NET 7 afaict.
Steps to reproduce
It's rather difficult to setup steps to reproduce considering that WinForms designer stack is not something that could be easily isolated. Obviously it somehow still works with Visual Studio own WinForms .NET 7 designer, as VS is a black box. I'm not sure where the disconnect is. What I'm looking for is to see if doc update of some sort is needed, or if a workaround is available.