Skip to content

Event-Exception: "Microsoft.Data.SqlClient.WriteCommandBefore" #86

Open
@AndrewP-GH

Description

@AndrewP-GH

We have netcoreapp3.1 app and Azure SQL DB and after we have added this package (v0.7.1) for tracing via .AddOpenTracing() method, we have this warning in logs:

SourceContext: OpenTracing.Contrib.NetCore.MicrosoftSqlClient.MicrosoftSqlClientDiagnostics
Exception.ClassName: System.InvalidCastException
Exception.Message: Unable to cast object of type
'<>f__AnonymousType0`6[System.Guid,System.String,System.Nullable`1[System.Guid],Microsoft.Data.SqlClient.SqlCommand,System.Nullable`1[System.Int64],System.Int64]' to type '<>f__AnonymousType1`7[System.Guid,System.String,System.Nullable`1[System.Guid],Microsoft.Data.SqlClient.SqlCommand,System.Nullable`1[System.Int64],System.Collections.IDictionary,System.Int64]'.
Exception.Source: OpenTracing.Contrib.NetCore
Exception.StackTraceString: at OpenTracing.Contrib.NetCore.Internal.PropertyFetcher.PropertyFetch.TypedFetchProperty`2.Fetch(Object obj)    at OpenTracing.Contrib.NetCore.Internal.PropertyFetcher.Fetch(Object obj)    at OpenTracing.Contrib.NetCore.MicrosoftSqlClient.MicrosoftSqlClientDiagnostics.HandleEvent(String eventName, Object untypedArg)    at OpenTracing.Contrib.NetCore.Internal.DiagnosticEventObserver.System.IObserver<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.OnNext(KeyValuePair`2 value)

I suggest that this unexpected field in the anonymous object is Statistics, but I don't understand how this can happen.
Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions