Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

SqlClientDiagnosticSourceListener OnNext failed to call event handler #1291

Closed
chassq opened this issue Oct 14, 2019 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@chassq
Copy link

chassq commented Oct 14, 2019

If you are reporting bug/issue, please provide detailed Repro instructions.

Repro Steps

  1. Upgrade to dotnet 3.0
  2. View live metrics in app insights

Actual Behavior

See the exception below. We do not think we saw this prior to upgrading to dotnet 3.0 (net core 3.0.100). Not sure why we are seeing this in out live metrics stream.

See this trace: AI (Internal): [Microsoft-ApplicationInsights-Extensibility-DependencyCollector] SqlClientDiagnosticSourceListener OnNext failed to call event handler. Error details 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Data.SqlClient.SqlConnection' to type 'System.Data.SqlClient.SqlConnection'. at Microsoft.ApplicationInsights.DependencyCollector.Implementation.SqlClientDiagnostics.SqlClientDiagnosticSourceListener.BeforeCommitHelper(KeyValuePair2 evnt, PropertyFetcher operationIdFetcher, PropertyFetcher connectionFetcher, PropertyFetcher operationFetcher, PropertyFetcher timestampFetcher, PropertyFetcher isolationFetcher, PropertyFetcher datasourceFetcher, PropertyFetcher databaseFetcher) at Microsoft.ApplicationInsights.DependencyCollector.Implementation.SqlClientDiagnostics.SqlClientDiagnosticSourceListener.System.IObserver<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.OnNext(KeyValuePair2 evnt)'

Expected Behavior

Not see the trace?

Version Info

SDK Version : 3.0.100
.NET Version : Dot Net Core 3
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Visual Studio
OS : Azure app service Windows
Hosting Info (IIS/Azure WebApps/ etc) : Azure app service

@cijothomas
Copy link
Contributor

2.11.2 released with fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants