XmlWriterTraceListener Constructor (String)


Initializes a new instance of the XmlWriterTraceListener class, using the specified file as the recipient of the debugging and tracing output.

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

public XmlWriterTraceListener(
	string filename


Type: System.String

The name of the file to write to.

Exception Condition

filename is null.

This constructor initializes a new instance of the StreamWriter class for the specified file on the specified path, using UTF8 encoding. If the file exists, it is appended to. If the file does not exist, a new file is created.


To reduce the chance of an exception, any character that might invalidate the output is replaced with a "?" character.

The Name property is initialized to an empty string ("").


for the ability to call unmanaged code. Associated enumeration: UnmanagedCode.

.NET Framework
Available since 2.0
Return to top