[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

The base class could not be loaded

I have created a simple project with two forms: 'form1' and 'baseform'

When I tried to inherit 'form1' from 'baseform' (Inherits baseform), the IDE displayed the following error message  :
----------------------------------------------------------------------------------------------------------------------------------------------
An error occured while loading the document. Fix the error, and then try loading the document again. The error message follows:

The disigner could bot be show for this file because none of the classes within it can be dsigned. The designer inspected the following classes in the file:

Form1 --- The base class 'Project.baseform' could not be loaded. Ensure the assembly has been referenced or build if it is part of the project.
------------------------------------------------------------------------------------------------------------------------------------------------

However the project still can run properly!

Thanks in advance.

0
vbhaha
Asked:
vbhaha
  • 2
  • 2
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
This is because you have some code in one the events raised when a form is loaded (Load, Activate, Paint, ...) in the PARENT class that cannot be evaluated for the designer.

Remove this code from these events and your child will appear correctly.
0
 
vbhahaAuthor Commented:
No, both form1 and baseform are simple blank form.

Anyway, I have solved the problem already. The solution is to rebuild the project before the form designer can display the inherited form!
0
 
vbhahaAuthor Commented:
Why I couldn't close this question ???
0
 
Éric MoreauSenior .Net ConsultantCommented:
You will have to ask the Community support
0
 
Computer101Commented:
PAQed, with points refunded (300)

Computer101
E-E Admin
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now