You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exception occurs on the .NET 3.5 runtime but not the .NET 4.0+ runtime, when executing the line "source.Kernel.All += Print;" in the sample code, below. Neither the same code nor my code doing something very similar work.
static void DataProcessing(string dataFileName)
{
Out.WriteLine("Opening the output file and printing the results.");
using (var source = new ETWTraceEventSource(dataFileName))
{
if (source.EventsLost != 0)
Out.WriteLine("WARNING: there were {0} lost events", source.EventsLost);
// Set up callbacks to
source.Clr.All += Print;
source.Kernel.All += Print;
...
Here is the Exception:
System.InvalidCastException occurred
Message=Unable to cast object of type 'System.Action1[Microsoft.Diagnostics.Tracing.TraceEvent]' to type 'System.Action1[Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData]'.
Source=Microsoft.Diagnostics.Tracing.TraceEvent
StackTrace:
at Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData.set_Target(Delegate value)
at Microsoft.Diagnostics.Tracing.TraceEventParser.Subscribe(SubscriptionRequest cur, TraceEvent template, Object templateState, Boolean mayHaveExistedBefore)
at Microsoft.Diagnostics.Tracing.TraceEventParser.<>c__DisplayClassb.b__a(TraceEvent template)
at Microsoft.Diagnostics.Tracing.Parsers.KernelTraceEventParser.EnumerateTemplates(Func3 eventsToObserve, Action1 callback)
at WindowsEtwDataCollector.EtwDataCollector.RunKernelTrace(ConditionChecker shouldAbort) in C:\dev\vault\Vault\DataCollectors\WindowsEtwDataCollector\EtwDataCollector.cs:line 174
InnerException:
Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData
.. is derived from ...
Microsoft.Diagnostics.Tracing.TraceEvent
System.InvalidCastException occurred
Message=Unable to cast object of type 'System.Action1[Microsoft.Diagnostics.Tracing.TraceEvent]' to type 'System.Action1[Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData]'.
Source=Microsoft.Diagnostics.Tracing.TraceEvent
StackTrace:
at Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData.set_Target(Delegate value)
at Microsoft.Diagnostics.Tracing.TraceEventParser.Subscribe(SubscriptionRequest cur, TraceEvent template, Object templateState, Boolean mayHaveExistedBefore)
at Microsoft.Diagnostics.Tracing.TraceEventParser.<>c__DisplayClassb.b__a(TraceEvent template)
at Microsoft.Diagnostics.Tracing.Parsers.KernelTraceEventParser.EnumerateTemplates(Func3 eventsToObserve, Action1 callback)
at WindowsEtwDataCollector.EtwDataCollector.RunKernelTrace(ConditionChecker shouldAbort) in C:\dev\vault\Vault\DataCollectors\WindowsEtwDataCollector\EtwDataCollector.cs:line 174
InnerException:
The text was updated successfully, but these errors were encountered:
The exception occurs on the .NET 3.5 runtime but not the .NET 4.0+ runtime, when executing the line "source.Kernel.All += Print;" in the sample code, below. Neither the same code nor my code doing something very similar work.
Here is the Exception:
System.InvalidCastException occurred
Message=Unable to cast object of type 'System.Action
1[Microsoft.Diagnostics.Tracing.TraceEvent]' to type 'System.Action
1[Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData]'.Source=Microsoft.Diagnostics.Tracing.TraceEvent
StackTrace:
at Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData.set_Target(Delegate value)
at Microsoft.Diagnostics.Tracing.TraceEventParser.Subscribe(SubscriptionRequest cur, TraceEvent template, Object templateState, Boolean mayHaveExistedBefore)
at Microsoft.Diagnostics.Tracing.TraceEventParser.<>c__DisplayClassb.b__a(TraceEvent template)
at Microsoft.Diagnostics.Tracing.Parsers.KernelTraceEventParser.EnumerateTemplates(Func
3 eventsToObserve, Action
1 callback)at WindowsEtwDataCollector.EtwDataCollector.RunKernelTrace(ConditionChecker shouldAbort) in C:\dev\vault\Vault\DataCollectors\WindowsEtwDataCollector\EtwDataCollector.cs:line 174
InnerException:
Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData
.. is derived from ...
Microsoft.Diagnostics.Tracing.TraceEvent
System.InvalidCastException occurred
Message=Unable to cast object of type 'System.Action
1[Microsoft.Diagnostics.Tracing.TraceEvent]' to type 'System.Action
1[Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData]'.Source=Microsoft.Diagnostics.Tracing.TraceEvent
StackTrace:
at Microsoft.Diagnostics.Tracing.Parsers.Kernel.EventTraceHeaderTraceData.set_Target(Delegate value)
at Microsoft.Diagnostics.Tracing.TraceEventParser.Subscribe(SubscriptionRequest cur, TraceEvent template, Object templateState, Boolean mayHaveExistedBefore)
at Microsoft.Diagnostics.Tracing.TraceEventParser.<>c__DisplayClassb.b__a(TraceEvent template)
at Microsoft.Diagnostics.Tracing.Parsers.KernelTraceEventParser.EnumerateTemplates(Func
3 eventsToObserve, Action
1 callback)at WindowsEtwDataCollector.EtwDataCollector.RunKernelTrace(ConditionChecker shouldAbort) in C:\dev\vault\Vault\DataCollectors\WindowsEtwDataCollector\EtwDataCollector.cs:line 174
InnerException:
The text was updated successfully, but these errors were encountered: