Duplicate TypeLibs Explained

Where do duplicates come from?

Most commonly duplicate TypeLibs/ProgID's come from different DLLs which implement different versions of the same component. As the component version changes and new DLLs are released, sometimes they have the same name and sometimes the file name is different. If you try to add two files with the same name to a project, Side-By-Side Manifest Studio will ask you to choose one file or the other.  You will need to make a decision which manifest progid to remove from the project.

Why duplicate ProgID's in the same DLL?

When a DLL implements multiple versions of a control, it may have multiple classes that reference the same TypeLib/ProgId. Let us, for an illustration, consider component registration in the registry.

Three classes, with class ID's beginning with hexadecimal digits BAD00001 (2), BAD00002 (5) and BAD00003(8), implement three variations (maybe versions) of the same component. All three version dependent ProgID's, (3), (6) and (9), end with a period and the version number. At the same time all three version independent ProgID's, (4), (6) and (10), are the same.

Ideally, the implementer of the class should remove two of them and leave only one. In real life that is frequently not done. Since registry rules do not prohibit this, the duplicate ProgID's can peacefully coexist even if all ProgID's (version independent and version dependent) in HKEY_CLASSES_ROOT\CLSID are the same.

Windows Side-by-Side changed the rules slightly and requires that there be no ambiguity during translation of ProgIDs to CLSID's and back. When building manifests we need to choose from duplicate values to resolve conflicts.

Note that values (13) and (14) are optional and only one of them needs to be present. In extreme cases you may see totally inconsistent references. For example from (12) through (13) or (14) to a class that does not even define ProgidSample.ProgIDSample or to a class that does not exist at all in your registry.

(1)        HKEY_CLASSES_ROOT\CLSID

(2)                 {BAD00001-A057-4836-8ED1-9FC8AEC7741F}

(3)                          ProgID        ProgidSample.ProgIDSample.1

(4)                          VersionIndependentProgID        ProgidSample.ProgIDSample

(5)                 {BAD00002-D142-4A69-90A5-5307535FA0E0}

(6)                          ProgID        ProgidSample.ProgIDSample.2

(7)                          VersionIndependentProgID        ProgidSample.ProgIDSample

(8)                 {BAD00003-9388-4882-A753-BBFDF8CCCFD1}

(9)                          ProgID        ProgidSample.ProgIDSample.3

(10)                          VersionIndependentProgID        ProgidSample.ProgIDSample

(11)        HKEY_CLASSES_ROOT

(12)                 ProgidSample.ProgIDSample

(13)                          CLSID        {BAD00003-9388-4882-A753-BBFDF8CCCFD1}

(14)                          CurVer        ProgidSample.ProgIDSample.2

(15)                 ProgidSample.ProgIDSample.1

(16)                          CLSID        {BAD00001-A057-4836-8ED1-9FC8AEC7741F}

(17)                 ProgidSample.ProgIDSample.2

(18)                          CLSID        {BAD00002-D142-4A69-90A5-5307535FA0E0}

(19)                 ProgidSample.ProgIDSample.3

(20)                          CLSID        {BAD00003-9388-4882-A753-BBFDF8CCCFD1}