Form Inheritance Error - "The base class could not be loaded"

G

Guest

Hi,

I am trying to use form inheritance in my application, and seem to have run
into some errors. I have a base form called frmBase, and two forms which
inherit from frmBase called frmInitialDisplay and frmSystemStatus. I can
compile and run the application fine, but whenever I try and view
frmInitialDisplay or frmSystemStatus in the designer I get the following
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: frmInitialDisplay --- The base class 'FMSMMI.frmBase' could not be
loaded. ensure the assembly has been referenced and that all projects have
been build"

I have searched a lot on the internet for this problem, and have tried all
the solutions that have been given. Specifically, I have tried rebuilding my
project, I've tried manually deleting all the output files and rebuilding and
I've tried moving all the files to a new project, and nothing has solved the
problem. I've checked that there are no strange characters in any of the
paths to the files (apparently when there are #'s in the path it can do
strange things).

I've tried creating a test project with a base form and an inherited form,
and that seems to work fine - I just can't get it to work in my main project,
even if I move all the code to a new Visual Studio project! Adding another
base form to this project and trying to get a form to inherit from that also
fails, with the same error.

This has definitely been working before in this project, and I think it was
working on Friday - but it now gives the errors detailed above.

I am writing this project in Visual C++, and am using Visual Studio 2005
with SP1.

Does anyone have any ideas why this might be happening, and what I can do
about it? Obviously it's holding up my development quite a bit, because I
can't get access to any of the derived forms to do any work on them!

Regards,

Robin
 
G

Guest

SP1 is the normal recommendation for these errors. The other option of the
top of my head is the base form being abstract which causes issues for
designer and it actually instantiates the base class.
 
G

Guest

Thank you for your response.

As I mentioned in my previous post, I already have SP1. I have also checked
that my base form is not abstract.

Does anyone have any other ideas? I'm getting a bit stuck as I can't
continue work on my application while I've got this problem!

Robin
 
G

Guest

Could you post the code of the Form to the group, I would be suspicous of you
having controls on your base form which are defined in other assemblies as
the visual studio designer surface may have issues finding their declaration.
If this is a problem, try GAC'ing the assemblies with the controls in them
to help VS find them
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top