PRB: Multiple Entries for Same ServicedComponent Class in Component Services Explorer (311034)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition

This article was previously published under Q311034

SYMPTOMS

You may notice that multiple versions of the same ServicedComponent class exist in the Component Services Microsoft Management Console (MMC) snap-in. The programmatic identifiers (ProgIDs) of the ServicedComponent are identical, although the class identifiers (CLSIDs) differ.

CAUSE

Every time you change the ServicedComponent assembly, the version of that assembly changes. Furthermore, when you register the dynamic-link library (DLL) dynamically, the CLSID changes. This creates multiple entries of the ServicedComponent with identical ProgIDs but different CLSIDs.

RESOLUTION

To resolve this problem, use one of the following methods.

Method 1: Change the Version of the Assembly

Change the version of the assembly in the AssemblyInfo.cs file from
[assembly: AssemblyVersion("1.0.*")]
				
to a fixed number, such as:
[assembly: AssemblyVersion("1.0.0.5")]
				

Method 2: Change the CLSID of the Class

  1. Add a reference to the System.Runtime.InteropServices namespace.
  2. Add the Guid attribute before the class declaration. For example:
    [Guid("12345678-ABCD-EFGH-IJKL-123456789012")]
    					

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:3/20/2002
Keywords:kbCOMPlusCatalog kbCOMServices kbprb KB311034