Inherited forms don't show up in VS designer

Visual inheritance was working just fine until now. The designer shows the parent form OK but the inherited ones gave me this error:
System.Windows.Forms.Design.IEventHandlerService service already exists in the service container. Parameter name: serviceType
Now the designer has changed its message and what I get is "Object reference not sent to an instance of an object". I opened the task list to see in which file the error was and there's nothing in the file column of the list. If I double click the task it just places me on the first line of code in the file where the form is declared.
The application still works fine though so I guess this must be an error with Visual Studio and not with my code.

Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
I had problem similar to that and I found that some parent form's events (like the Load event) are runned in the IDE when child forms are displayed.

Try removing the code from these events.
This seems to have something to do with inheriting a Form_Load function from the base form. remove the Form_Load form the template and you will stop getting this error.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.