From d11e0c9c2304e886c9c4e737ce6ba6910ca9868c Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Thu, 19 Mar 2026 20:14:50 -0700 Subject: [PATCH] Add missing WCF infrastructure event templates to ApplicationServerTraceEventParser The ApplicationServerTraceEventParser had event ID constants defined for WCF infrastructure events (57394-57410) but no corresponding event handler properties or template entries in EnumerateTemplates(). This caused these events to display as 'EventID(57394)' etc. instead of their proper names like 'HandledException' and 'ThrowingEtwException'. Added 16 missing event handler properties and template registrations for: - HandledException (57394), ShipAssertExceptionMessage (57395), ThrowingException (57396), UnhandledException (57397) - TraceCodeEventLog* variants (57399-57403) - HandledExceptionWarning/Error/Verbose (57404-57406) - ThrowingExceptionVerbose (57407), EtwUnhandledException (57408) - ThrowingEtwExceptionVerbose (57409), ThrowingEtwException (57410) Template types and field definitions were matched to the WCF ETW manifest (Microsoft-Windows-Application Server-Applications provider). Also registered ApplicationServerTraceEventParser as a standard parser in TraceLog so that PerfView's ETLX conversion picks up these templates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ApplicationServerTraceEventParser.cs | 211 +++++++++++++++++- src/TraceEvent/TraceLog.cs | 1 + 2 files changed, 211 insertions(+), 1 deletion(-) diff --git a/src/TraceEvent/Parsers/ApplicationServerTraceEventParser.cs b/src/TraceEvent/Parsers/ApplicationServerTraceEventParser.cs index 4f4f84635..9c533b8ac 100644 --- a/src/TraceEvent/Parsers/ApplicationServerTraceEventParser.cs +++ b/src/TraceEvent/Parsers/ApplicationServerTraceEventParser.cs @@ -6053,6 +6053,199 @@ public event Action HttpHandlerPickedForUrl } } + public event Action HandledException + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57394, 8140, "HandledException", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57394, ProviderGuid); + } + } + public event Action ShipAssertExceptionMessage + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateEATraceData(value, 57395, 8139, "ShipAssertExceptionMessage", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57395, ProviderGuid); + } + } + public event Action ThrowingException + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new FourStringsTemplateEATraceData(value, 57396, 8138, "ThrowingException", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57396, ProviderGuid); + } + } + public event Action UnhandledException + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57397, 8137, "UnhandledException", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57397, ProviderGuid); + } + } + public event Action TraceCodeEventLogCritical + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateTATraceData(value, 57399, 8135, "TraceCodeEventLogCritical", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57399, ProviderGuid); + } + } + public event Action TraceCodeEventLogError + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateTATraceData(value, 57400, 8134, "TraceCodeEventLogError", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57400, ProviderGuid); + } + } + public event Action TraceCodeEventLogInfo + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateTATraceData(value, 57401, 8133, "TraceCodeEventLogInfo", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57401, ProviderGuid); + } + } + public event Action TraceCodeEventLogVerbose + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateTATraceData(value, 57402, 8132, "TraceCodeEventLogVerbose", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57402, ProviderGuid); + } + } + public event Action TraceCodeEventLogWarning + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new TwoStringsTemplateTATraceData(value, 57403, 8131, "TraceCodeEventLogWarning", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57403, ProviderGuid); + } + } + public event Action HandledExceptionWarning + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57404, 8130, "HandledExceptionWarning", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57404, ProviderGuid); + } + } + public event Action HandledExceptionError + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57405, 8129, "HandledExceptionError", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57405, ProviderGuid); + } + } + public event Action HandledExceptionVerbose + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57406, 8128, "HandledExceptionVerbose", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57406, ProviderGuid); + } + } + public event Action ThrowingExceptionVerbose + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new FourStringsTemplateEATraceData(value, 57407, 8127, "ThrowingExceptionVerbose", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57407, ProviderGuid); + } + } + public event Action EtwUnhandledException + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new ThreeStringsTemplateEATraceData(value, 57408, 8126, "EtwUnhandledException", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57408, ProviderGuid); + } + } + public event Action ThrowingEtwExceptionVerbose + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new FourStringsTemplateEATraceData(value, 57409, 8125, "ThrowingEtwExceptionVerbose", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57409, ProviderGuid); + } + } + public event Action ThrowingEtwException + { + add + { + // action, eventid, taskid, taskName, taskGuid, opcode, opcodeName, providerGuid, providerName + source.RegisterEventTemplate(new FourStringsTemplateEATraceData(value, 57410, 8124, "ThrowingEtwException", Guid.Empty, 0, "Info", ProviderGuid, ProviderName)); + } + remove + { + source.UnregisterEventTemplate(value, 57410, ProviderGuid); + } + } + #region Event ID Definitions private const TraceEventID WorkflowInstanceRecordEventID = (TraceEventID)100; private const TraceEventID WorkflowInstanceUnhandledExceptionRecordEventID = (TraceEventID)101; @@ -6544,7 +6737,7 @@ protected internal override void EnumerateTemplates(Func