VS2012 Toolbox issue with control versions

ViperGTI

Well-Known Member
Joined
Mar 29, 2012
Messages
382
Reaction score
0
Location
Centurion
I have a shared library that contains classes and controls that I use in all my projects. All my projects reference the dll in its bin\Release folder directly and the controls in my VS2012 toolbox also references that same dll.

However, if I increment the version on the shared library and compile it, whenever I try to draw the control from the toolbox onto a form in one of my existing projects, I get an error:
Failed to create component 'control_name'. The error message follows:
'System.Runtime.InteropServices.COMException (0x8004D745): A reference to the component 'library_name' already exists in the project.

The project has already been compiled with the latest version of the shared library and the toolbox is pointing to the correct location where the latest version of the shared library resides. If I remove all the shared library's controls from the toolbox and then add them again, then it works fine. Never had this issue with VS2010.

Any ideas how to get around this as it is quite a mission.
 
Why do you reference the DLL directly? Because its in a different solution?

I'm assuming it's a COM object since it is complaining about interops? So maybe 2012 does some signature things with COM interops when you first reference it and then the signature isn't the same when you increment the version number.
 
Yes. But the problem isn't only with my dll. I have the same problem with 3rd party components if I replace the dll (not registered in the GAC) with a newer version.

Actually it is not a com object which is also why it is weird. But I think the issue is related to VS2012 storing the version number of the controls loaded in the toolbox as it was when it was added to the toolbox and then ignores the actual version number of the underlying library whereas VS2010 checked the version numbers while loading the toolbox (which is probably why VS2012 loads so quickly).
So perhaps what I'm looking for is an utility / plugin that runs through the toolbox and refreshes the version number for each control.
 
Haven't had this issue. Will see of I can recreate the problem over the weekend.
 
Top
Sign up to the MyBroadband newsletter
X