I use MS visual studio 2010. I did open designer and view the form for the same file A before. But after some small changes, I can no longer view the form designer.vb, but can only view code in designer.vb. Even if I go back to the original source, I still can not open designer!!
The error is:
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following clsses in the file A-The base class BaseClass could not be loaded. Ensure the assembly has been referenced and all that projects have been built.
I checked that the file A inherits from the BaseClass. The BaseClass has a simple form and can be viewed by designer. I have a successful build. Actually, I can run the program correctly. I even tried delete bin and objects then build, but nothing helps.
I have many files that can not be opened in designer.vb. This is killing me! How can I make changes to the form then? Directly write code to designer.vb? But many suggest that do not write code directly in designer.vb
Use Project + Add Class to add classes to your project, don’t put them in the form’s source code file. If you have to then add them to the bottom or nested inside the form class, don’t put them ahead of the form class declaration. The form class must be first.