Prevent Duplicate Entries for Serviced Components

Problem

When you update a serviced component, it’s registered in the COM+ catalog with a different type library and component GUID.

Solution

Specify the version number of your assembly and GUID of your classes using attributes.

Discussion

By default, every time you register a serviced component, a new type library will be generated, and all the classes it contains will be given new GUIDs. This leads to duplicate entries in the COM+ catalog, which can cause significant confusion. Fortunately, resolving these problems is easy.

The first step is to fix the version number of your assembly. Microsoft Visual Studio .NET creates all applications with the following attribute in the AssemblyInfo.vb file:

<Assembly: ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.