Create a COM+ Serviced Component

Problem

You want to create a component that can use COM+ services such as distributed transactions and object pooling.

Solution

Derive your component from the ServicedComponent class, give your assembly a strong name, and register it in the COM+ catalog using the regsvcs.exe utility.

Discussion

To use COM+ services (as described in recipes Create a Pooled Component and Use a COM+ Distributed Transaction), you must create your component as a class library assembly and add a reference to the System.EnterpriseServices.dll assembly. You can then add one or more classes that derive from System.EnterpriseServices.ServicedComponent. These classes do not need any additional COM-specific code. They gain the ability to use a ...

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.