This documentation is archived and is not being maintained.

TypeDescriptor.AddProvider Method (TypeDescriptionProvider, Object)

Adds a type description provider for a single instance of a component.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public static void AddProvider(
	TypeDescriptionProvider provider,
	Object instance


Type: System.ComponentModel.TypeDescriptionProvider

The TypeDescriptionProvider to add.

Type: System.Object

An instance of the target component.


One or both of the parameters are null.

The AddProvider(TypeDescriptionProvider, Object) method adds a type description provider that supplies type information for a single instance of a component. If a provider is added by this method, the provider's CreateInstance method will not be called because the instance already exists.

This method does not maintain a hard reference to the component, so it does not prevent the component from finalizing.

It is possible to add multiple type description providers for the same type or object. If this occurs, the first type description provider encountered that provides type information will be used exclusively. Since type information providers are stored in a stack, the last provider added will be the first one queried. This behavior enables the AddProvider(TypeDescriptionProvider, Object) and RemoveProvider methods to be used to push and pop type description providers as required for particular scenarios.

If successful, this method calls the Refresh(Object) method on the instance parameter.


The two versions of this method produce results with different scopes. The AddProvider method that takes an Object parameter affects only that single instance of the component specified. In contrast, the other overload, which takes a Type parameter, affects all instances of the component described by that type.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0