question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EventSourceException whilte processing event "Exception" or "Metric"

See original GitHub issue

Repro Steps

There were couple new issues reported in Application Insights SDK telemetry:

  • AI (Internal): EventSourceException while processing event "Exception": System.Reflection.TargetException:Non-static method requires a target.

  • AI (Internal): EventSourceException while processing event "Metric": System.Reflection.TargetException:Non-static method requires a target.

This issue seems to affect multiple customers.

Version Info

SDK Version : 2.5.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:30 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
steven-rcommented, Sep 11, 2018

Just for convenience a stack dump as requested above:

Exception thrown: System.Reflection.TargetException: Non-static method requires a target.
 at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) thrown at at reindlit.sparkleweb.app.Program.CurrentDomain_FirstChanceException(Object sender, FirstChanceExceptionEventArgs e) in D:\agent\_work\10\s\reindlit.sparkleweb.app\Program.cs:line 23
 at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
 at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
 at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
 at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
 at System.Diagnostics.Tracing.PropertyValue.<>c__DisplayClass33_0.<GetBoxedValueTypePropertyGetter>b__0(PropertyValue container)
 at System.Diagnostics.Tracing.NullableTypeInfo.WriteData(TraceLoggingDataCollector collector, PropertyValue value)
 at System.Diagnostics.Tracing.InvokeTypeInfo.WriteData(TraceLoggingDataCollector collector, PropertyValue value)
 at System.Diagnostics.Tracing.InvokeTypeInfo.WriteData(TraceLoggingDataCollector collector, PropertyValue value)
 at System.Diagnostics.Tracing.EventSource.WriteImpl(String eventName, EventSourceOptions& options, Object data, Guid* pActivityId, Guid* pRelatedActivityId, TraceLoggingEventTypes eventTypes)
 at System.Diagnostics.Tracing.EventSource.Write[T](String eventName, EventSourceOptions options, T data)
 at Microsoft.ApplicationInsights.Extensibility.Implementation.RichPayloadEventSource.WriteEvent[T](String eventName, String instrumentationKey, IDictionary`2 tags, T data, Int64 flags, EventKeywords keywords)
 at Microsoft.ApplicationInsights.Extensibility.Implementation.RichPayloadEventSource.Process(ITelemetry item)
 at Microsoft.ApplicationInsights.TelemetryClient.Track(ITelemetry telemetry)
 at Microsoft.ApplicationInsights.TelemetryClient.TrackTrace(TraceTelemetry telemetry)
 at Microsoft.ApplicationInsights.TelemetryClient.TrackTrace(String message)
 at reindlit.sparkleweb.app.Program.CurrentDomain_FirstChanceException(Object sender, FirstChanceExceptionEventArgs e) in D:\agent\_work\10\s\reindlit.sparkleweb.app\Program.cs:line 25

In addition there was an interesting link to this issue here.

2reactions
pharringcommented, Oct 8, 2018

It’s a bug in corefx and affects .NET Core only. We won’t try and work-around it in App Insights. We’ll get it fixed in .NET Core. If it’s a straightforward (low risk) fix, we’ll also push for porting the fix down-level into the LTS branch. Thanks for your help getting the call-stack and narrowing down the issue, @steven-r. This issue can probably be closed now that we understand what causes it and that we’ve decided not to do anything in App Insights.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventSourceException while processing event "LogVerbose"
While using EventHubTrigger Azurefunction such a ugly exception received (As below) in telemetry traces of ApplicationInsights. AI (Internal): [ ...
Read more >
EventSourceException Class (System.Diagnostics.Tracing)
The exception that is thrown when an error occurs during event tracing for Windows (ETW). public ref class EventSourceException : Exception. C# Copy....
Read more >
https://raw.githubusercontent.com/dotnet/samples/m...
I think there's a bug where I am using the same login to connect to a database, while another process is doing the...
Read more >
Has az login stopped working in Ubuntu 20.04?
... EventSourceException while processing event "LogVerbose" ... Azure Diagnostic Agent has Stopped Working (Exception: StorageAccount is null) ...
Read more >
Viewing online file analysis results for 'SSDT-Setup-ENU.exe'
Contains ability to register a top-level exception handler (often used as anti-debugging trick). details: SetUnhandledExceptionFilter@KERNEL32.dll (Show Stream)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found