Skip to content

Inherited forms don't work in the designer for .NET Core #3338

@ekolis

Description

@ekolis
  • .NET Core Version:
    3.1

  • Have you experienced this same bug with .NET Framework?:
    No

Problem description:

  1. Create a .NET Core WinForms app.
  2. Create a form.
  3. Create a second form.
  4. Edit the second form's code behind to make it inherit from the first form.
  5. Open the visual designer for the second form.

The designer will then crash with this error:

The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: \r\n Form2 --- The base class 'BrokenFormsInheritance.Form1' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. | The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: \r\n Form2 --- The base class 'BrokenFormsInheritance.Form1' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
-- | --
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: \r\n Form2 --- The base class 'BrokenFormsInheritance.Form1' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

  1. Build the project as the error indicates.

The error will remain regardless of if I build the project.

Expected behavior:

The designer opens.

Minimal repro:

see attached

BrokenFormsInheritance.zip

Metadata

Metadata

Assignees

Labels

area-VSDesignerWindows Forms out-of-proc designer related issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions