Seemingly a vicious circle here. I’ve just taken on a project that won’t build. The reason it won’t build is because I have a lot of “does not exist in the current context” errors with regards to controls that definitely would exist in the current context if I could view the forms in design mode. But I can’t view them in design mode because they inherit from a class that inherits from Form that seems to be causing a problem.
Now, I thought the problem may have been that the class that inherits from Form may have been accidentally tampered with as it had the form icon in the solution explorer but should have been just the standard .cs file. So I ‘broke it out’ of that context and put it in a new .cs file (as explained somewhere else on another SO thread). So I’m stuck here now, don’t know what to do.
Error message:
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: frmMain — The base class ‘MyCustomForm.MyCustomForm’ could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Comment out all of the code that uses those controls, build your project, then uncomment them.