views:

474

answers:

3

Hi,

I'm using a3rd party component in my project and I recently upgraded to their latest version which fixed bug 'A'

unfortunately, while it solved bug 'A', another part has gotten completely unstable, so it introduced a bug 'B'.

Since 'A' and 'B' are in completely different contexts, I want to have both versions of the control installed and use the one in one case where bug 'B' is not relevant, and the other one in the case that bug 'A' is not relevant.

of course, everything until a proper fix has been issued by the 3rd party developer

Anyone any thought how this can be done?

R

p.s. the dll needs to be registered with regsvr32... I suspect this is the point where it makes itself findable... I'm hoping with some trickery it is here we can register the thing double under a different name

A: 

You can only register one COM dll of the same type on your machine... this is why the GAC is introduced by .Net

Gerrie Schenck
That is true, but you can also use components without registering them.
0xA3
Not a COM component you can't.
Charles Bretana
Yes, since Windows XP you can use COM without the Registry. See the link in my answer or here: http://msdn.microsoft.com/en-us/magazine/cc188708.aspx
0xA3
@divo, thanks, didn't know that... gawd, there's just no way to keep up....
Charles Bretana
+2  A: 

You can deploy different version of a COM component and use them without registration. This feature of registration-free COM has been introduced with Windows XP and requires you to deploy a .manifest file with the appropriate settings.

Have a look at Registration-Free Activation of COM Components and Escape DLL Hell: Simplify App Deployment with ClickOnce and Registration-Free COM.

0xA3
although it seems like a lot of hassle (config files etc).. this looks exactly what I'm looking for. I'm going to try this
Toad
+1 for promulgating this.. Had no idea this had happened...
Charles Bretana
Although I don't think it is possible to use two different versions of the same COM component within the same process/application as they are still identified by their GUID. In that case the solution proposed by Charles might be better.
0xA3
at the end of article 1 they say (in the conclusion) It enables applications with dependencies on different versions of the same COM component to share an infrastructure and to load those various COM component versions side by side in an echo of the .NET Framework versioning and deployment mechanism.-------does this mean it can or can't be done?
Toad
A: 

If the third party component is a COM component, then you're on the right track, you need to register it twice using different names/Guids.

EDIT: see divo answer about multiple COM registration... After XP you can do this now...
But before that the only way to do this (short of having the source code and recompiling a new dll yourself with different registration guids), was to manually modify the type library, and replace the existing guids with new ones. This would be extremely difficult. (There may exist a tool to do this, but if there is I don;t know of it) The type library, by the way may be embedded in the dll itself, or it may be in a separate *.tlb file (common for VB6 components)

If, otoh, the component is a managed code component, then the registry may only be necessary for integration into visual studio, and it will be sufficient to just copy the dll into the application folder for the executable you are using it in...

Charles Bretana