Cannot add custom WinForms control built with .NET 8 to Visual Studio Toolbox (“platform whose toolbox items cannot be enumerated dynamically”)
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
### .NET version
8.0
### Did it work in .NET Framework?
Yes
### Issue description
When building a simple WinForms control library targeting .NET 8-windows, attempting to add the generated DLL to Visual Studio’s Toolbox using Choose Toolbox Items → Browse… fails with an error.
Is Visual Studio expected to support adding WinForms controls built for .NET 8-windows directly via Choose Toolbox Items → Browse…?
Is there any official documentation or roadmap reference that describes Toolbox support (or lack thereof) for modern .NET controls?
### Steps to reproduce
1. Create a new Class Library targeting .NET 8-windows with true.
2. Add a public control:
```
using System.Windows.Forms;
using System.ComponentModel;
namespace Net8ToolboxControl
{
[ToolboxItem(true)]
public class FancyButton : Button
{
public FancyButton()
{
this.Text = "Fancy .NET 8 Button";
this.BackColor = Color.LightGreen;
}
}
}
```
3. Build the DLL.
4. In Visual Studio 2022 ( in my case version is 17.12.3), open Tools → Choose Toolbox Items → Browse… and select the built DLL.
A minimal reproducible project Net8ToolboxControl.zip is attached which uses step mentioned above:
[Net8ToolboxControl.zip](https://github.com/user-attachments/files/23256804/Net8ToolboxControl.zip)
Contributor guide
Assessment
This issue has not been assessed yet.