-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
Repro:
using System;
using System.Diagnostics.Tracing;
class Program
{
static void Main()
{
var source = new MySource();
var listener = new MyListener();
source.Data(new byte[] { 1, 2, 3, 4, 5 });
}
}
class MySource : EventSource
{
[Event(1)]
public void Data(byte[] data) => WriteEvent(1, data);
}
class MyListener : EventListener
{
protected override void OnEventSourceCreated(EventSource eventSource) =>
EnableEvents(eventSource, EventLevel.Verbose);
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
foreach (var item in eventData.Payload)
{
byte[] data = item as byte[];
if (data != null)
{
Console.WriteLine("Data: " + string.Join(",", data));
}
}
}
}
This should print out Data: 1, 2, 3, 4, 5. Instead it prints out Data: 1, 1, 1, 1, 1.
This repros for me on both the .NET Framework and .NET Core.
Metadata
Metadata
Assignees
Labels
No labels