|
Hi, I have a COM server dll developed in C#. We create two copies of the dll and register them in Registry with two different ProgIds and CLSIDs. For example, I will build my C# DLL project twice to generate ComServer1.dll and ComServer2.dll. Then I will add registry entries (manually) for the same (using CodeBase as the dlls are not placed in GAC). From the COM client (managed or unmanaged), I can access the COM Servers using the progIds (COMServer1ProgId or COMServer2ProgId). In the C# dll (COM Server), I find the CodeBase of the assembly (this.GetType().Assembly.CodeBase) to know which of the ProgIds (if codebase is ComServer1, then progId is ComServer1ProgId as so on) has been used by the client to connect to the server (based on that I will do different things on the server). Now the above mechanism works fine and everything. I was thinking if there is a way in which I do not have to create/build multiple copies of C# dll. Say I have only one copy ComServer.dll. Then I create two registry entries (with different progIds and Clsids, but same codebase), then when COM Client invokes the Server, I need to know which ProgId or ClsId is used by the client. Basically I want to know this in the constructor of the C# COM server dll. Kindly provide your inputs. Regards.
|