Some .NET 7 WinForms controls still reference .NET Framework 4.8
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 1d 13m
- Merged PRs (30d)
- 85
Description
### .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:
~~~
[ToolboxItem($"System.Windows.Forms.Design.AutoSizeToolboxItem,{AssemblyRef.SystemDesign}")]
public partial class Label : Control, IAutomationLiveRegion
~~~
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.
Contributor guide
Assessment
This issue has not been assessed yet.