Jun 24
If you encounter this warning while compiling a Windows Form application in Visual Studio:
The service System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType
The solution is not very obvious, and the help provides no guidance. After a little experimenting, I discovered an easy solution:
- Exit Visual Studio.
- Open Explorer, and navigate to the folder that contains your project.
- Delete the โbinโ and โobjโ folders.
- Restart Visual Studio, load your project and re-compile. The error should be gone.
This problem occurred when I attempted to inherit a derived Form from a class other than Form. When I changed it back to once again inherit from Form, the warning appeared.
You need to exit Visual Studio because you cannot delete the folders while the project is open.
Thanks, this solution worked for me..
Thanks, worked for me too.
unfortunately this did not work for me. The forms will not load in the designer and I’m totally stumped. Any other ideas as I’m dead in the water. Thank you.
Thanks, this worked
Didn’t work for me. Problem arose after adding a context-menu handler to a form that inherited from another.
Thanks!!!!! this worked just perfect!!
if it does not also add this line in Load event of the base class:
if (DesignMode) return;
Thanks a lot; it worked for me too.,, ๐
Thanks it worked for me! This were very helpfull!
it works!
good! thanks!
THANK YOOOUUUUU
thanks this is works for me.. helpful a lot.. good job the service provide still no guidance and i hope microsoft will fix this problem or issue.
it worked…….
Its working for me Thank you!
Works !!
Thanks
Thanks this worked for me!
Thanks
This pointed me in the right direction. I got this error just after updating a 3rd party control. Restarting Visual Studio (2013) fixed it.
Many thanks. Worked!
A_Johel on March 6th, 2012 at 12:47 am
if it does not also add this line in Load event of the base class: if (DesignMode) return;
—
That helped me! Thanks.
just exit VS and open the project again, worked for me!
really helpful..thanks
it worked for 1st time bt not for 2nd..pls help
the method doesn’t work for me
Many thanks. It worked (Y)
It Works Thanks!
thanks a lot .. its worked perfectly