dotnet / dotnet/winforms

Some .NET 7 WinForms controls still reference .NET Framework 4.8

Open
#9,767 1 comment 0 reactions 1 assignee Claimed by @Shyam-Gupta View on GitHub
area-DesignerSupport tenet-compatibility
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.