winforms
winforms copied to clipboard
UserControls with type parameters cannot be designed in .NET Core
Environment
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.9.2
.NET version
.NET 8
Did this work in a previous version of Visual Studio and/or previous .NET release?
Yes it worked in .NET Framework
Issue description
UserControls with type parameters cannot be designed in .NET Core
Steps to reproduce
https://github.com/janseris/WinFormsGenericUserControlDesignerTest And open designer for all UserControls in the NetCore projct
https://github.com/dotnet/winforms/assets/64279914/aa6d36a1-41dc-4707-bdbf-b1659608cc66
related to #3328 and #10368
Its on the teams backlog, but is unlikely to be done.
CC: @merriemcgaw
@elachlan thanks for info. btw this is not a suggestion or feature request but a bug because it works in Framework It is stopping us from adopting Core
@janseris Thanks for reaching out about the issue. Knowing it is blocking your adoption of Core is a key piece of feedback we need in the prioritization process! @KlausLoeffelmann let's discuss this issue, and whether we can get it on a future release.
Yeah, generic controls that derive from a non-generic type, should be designable.
public partial class FilesListViewBase<TFileModel> : UserControl
where TFileModel : FileModelBase
{
I (have to) (absolutely) agree. @Olina-Zhang, can you create a corresponding designer issue, and assign it to me? Targeting 17.11 > Preview 2.
Filed a designer issue: https://github.com/microsoft/winforms-designer/issues/5906.