Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventSource::WriteEvent Method (Int32, array<Byte>^)

.NET Framework (current version)
 

Writes an event by using the provided event identifier and byte array argument.

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

protected:
void WriteEvent(
	int eventId,
	array<unsigned char>^ arg1
)

Parameters

eventId
Type: System::Int32

The event identifier. This value should be between 0 and 65535.

arg1
Type: array<System::Byte>^

A byte array argument.

eventid should be greater than 0 or less than 65535 or errors can occur in the operation. If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.

When you implement a method that is identified as an ETW event in an EventSource-derived class. You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.

[Event(2, Level = EventLevel.Informational)]
public void Info1(byte[] arg1)
{
 base.WriteEvent(2, arg1);
}

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show:
© 2017 Microsoft