The Designer could not be shown for this file because none of the classes within it can be designed.

Trevor Daniels 31 Reputation points
2021-08-29T18:00:22.637+00:00

I have a project produced in Visual Studio 2017. I have just downloaded Visual Studio 2022 and tried to open the project. Although all of the code can be viewed, I can't see any of the Forms. I get:

"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: StartForm - the Base class 'System.Windows.Forms.Form' could not be loaded. Ensure that the assembly has been referenced and that all projects have been built."

Can someone please explain this and offer a solution?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,732 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Serge Dornseiffer 16 Reputation points
    2021-12-07T13:34:45.043+00:00

    Any news on this. Visual Studio 2022 was released and the issue persists.

    3 people found this answer helpful.
    0 comments No comments

  2. 84374270 11 Reputation points
    2023-03-17T06:45:36.98+00:00

    Please try to :

    • Quit Visual Studio
    • Delete all "Bin" and "Obj" folders
    • Restart Visual Studio

    This worked for me

    2 people found this answer helpful.

  3. Henrik Larsen 6 Reputation points
    2022-04-28T10:09:36.427+00:00

    I have this problem in latest VS20222 of today.

    I have created and shared a solution to show the problem.

    In this solution both FormMain and FormMiddle causes designer to show error when you try to design these.

    1 person found this answer helpful.
    0 comments No comments

  4. Steve Dinn 6 Reputation points
    2022-05-09T13:16:06.623+00:00

    I have derived / inherited forms that I successfully created and edited in a previous version of VS2019 that I can no longer edit in the latest update of VS2019 (v16.11.13) nor in VS2022 (v17.1.6). I'm screwed until or unless this bug is fixed.

    1 person found this answer helpful.
    0 comments No comments

  5. Xingyu Zhao-MSFT 5,366 Reputation points
    2021-09-06T08:08:18.9+00:00

    Hi @Trevor Daniels ,
    Try closing/reopening the designer in vs2022.
    It seems to be a known problem with vs2022
    Besides, since VS2022 is still in development and testing, you can download it after the official version is released.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.