TraceListenerCollection.IList.Add Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

Adds a trace listener to the TraceListenerCollection.

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

int IList.Add(
	object value


Type: System.Object

The object to add to the TraceListenerCollection.

Return Value

Type: System.Int32

The position into which the new trace listener was inserted.

Exception Condition

value is null.


value is not a TraceListener.

Use the Add method to add a new trace listener to the collection.

.NET Framework
Available since 1.1
Return to top