Solved

Inherited forms don't show up in VS designer

Posted on 2004-04-20
2
346 Views
Last Modified: 2008-12-11
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.

0
Comment
Question by:SergioFlorezM
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 10873675
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.
0
 
LVL 8

Expert Comment

by:nishikanth
ID: 10875096
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.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question