I have a C# .NET class library which I have exposed in COM by generating a tlb. This will be used in excel VBA by users to create their own functionality. I call this as ‘MyLib.dll’ and ‘MyLib.tlb’.
We are now in UAT mode and is deployed to users machine in C:\UAT[my app binaries]. So, I register my dll from this path as regasm C:\UAT\MyLib.dll /codebase.
But when we move to production, we would deploy to C:\PROD\[my app binaries]. So, I would register it as regasm C:\PROD\MyLib.dll /codebase.
This would not work, since the prod version will break the old UAT version of tlb. Hence, the users spread sheets which use the UAT version of my tlb would not work. Also, going forward, I cannot release with different name of the library for UAT and PROD because the code base is the same and I cannot keep changing the project or tlb name for each of the versions.
How to tackle this situation or is there any way to make it work where tlb name and functions are the same and can work based on the path where it is deployed or what is the general best practice to have many versions of the tlb on the same machine.
Many Thanks.
What I have found out after all the research and tries is that, it is not possible to have two tlbs with name registered in the machine even if from a different path. The registry entries that are created on registering the tlb types uses the name of the containes types. Hence, there is no way we can have two tlbs with the same name and verion even if running from a different path. Hope this helps !