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

SqlClientDiagnosticSourceListener OnNext failed to call event handler #1291

@chassq

Description

@chassq

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions