Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AndrewP-GH opened this issue Jan 14, 2021 · 0 comments · May be fixed by #89
Open

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

AndrewP-GH opened this issue Jan 14, 2021 · 0 comments · May be fixed by #89

Comments

@AndrewP-GH
Copy link

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?

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

Successfully merging a pull request may close this issue.

1 participant