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.
Popularity: 7% [?]
Related posts:

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.