Error Screen When Opening VB Form Design Module

njl100 41 Reputation points
2021-07-28T14:46:19.71+00:00

In Visual Studio 2019 Community Edition I have started getting the attached error screen when I open the form design module for 1 of my forms. This has just started appearing for no apparent reason. The variable concerned is a User Control I created in the app a few years ago and have not touched since and I haven't a clue how to fix this. If I ignore the error message and go into the form it looks ok, the application will build ok and it runs ok with no obvious errors on this particular form.
I saved a snapshot of the solution about a year ago so restored that onto my system and did a code compare both for the designer modules for the user control and for the form on which it is happening and they are identical to those on the current system. The error screen does not occur when I open this form on this old version of the solution.

Can anyone suggest what I need to do to make this problem go away.

TIA

118754-capture.jpg

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

Accepted answer
  1. Michael Taylor 54,316 Reputation points
    2021-07-28T15:30:56.603+00:00

    Couple of things come to mind.

    1) If the UC type is in the same project then the project must build before the designer can load it properly. Often it is better to keep the controls in a separate project so the designer can load them even if the main app doesn't compile.
    2) Are you using the new Winforms designer? If so switch to the legacy designer and see what happens. It could be a bug in the new designer.


0 additional answers

Sort by: Most helpful

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.