Assembly add a reference to itself when adding user controls from the ToolBox?!?!?!?!
Posted on 2011-02-25
I have an assembly with some UserControl's in it. Whenever I add one of those user controls to a WinForm, VS2010 adds a reference to it's own assembly. From then on, I get warnings that there are duplicate definitions of the user control class (the local version, and the version that is compiled in the referenced dll). I can't edit and continue any of these classes because even though there are no errors after editing, it can't make the changes to the referenced/compiled assembly.
Once I remove the "extra" reference, then the warnings go away, and I can edit/continue again.
This only happens when I drag the control onto a form from the Toolbox.
Why would visual studio add this circular reference though? Seems strange.
IT's easy enough to fix, but annoying when I forget that this is what's going on.