This documentation is archived and is not being maintained.

Private Components

A public component can be activated from other applications, but you might have several helper components in an application that are meant to be called only from other components within that application. In COM+, you can mark these components as private using the PrivateComponentAttribute attribute. A private component can be seen and activated only by other components in the same application. If you call any classes of a private component, it fails out-of-process but succeeds in-process. In contrast, if you call any classes on a public component, it succeeds both in-process and out-of-process.

Private components provide the developer with more control over what functionality to expose. You need only document and maintain the public components. You also have the option of creating private components that cannot be accessed from outside the application but might still take advantage of all COM+ services.

The following example shows how to use the PrivateComponentAttribute attribute on a class:

<PrivateComponent()> Public Class CPrivate 
Inherits ServicedComponent
[C#]
[PrivateComponent] 
public class CPrivate : ServicedComponent

See Also

Summary of Available COM+ Services | System.EnterpriseServices Namespace

Show: