You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If System.Net.Http raises the events with one type, and Grpc.Net.Client raises the events with a different type, then TypedFetchProperty throws an error.
AI (Internal): [Microsoft-ApplicationInsights-Extensibility-DependencyCollector] HttpCoreDiagnosticSourceListener OnNext failed to call event handler. Error details 'System.InvalidCastException: [A]ActivityStartData cannot be cast to [B]ActivityStartData. Type A originates from 'Grpc.Net.ClientFactory, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad' in the context 'Default' at location '/app/Grpc.Net.ClientFactory.dll'.
Type B originates from 'System.Net.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location '/usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.4/System.Net.Http.dll'.
at Microsoft.ApplicationInsights.Common.PropertyFetcher.PropertyFetch.TypedFetchProperty`2.Fetch(Object obj)
at Microsoft.ApplicationInsights.DependencyCollector.Implementation.HttpCoreDiagnosticSourceListener.OnNext(KeyValuePair`2 evnt)'
To Reproduce
With AI configured, make a web request with HttpClient, and make a gRPC request with Grpc.Net.Client.
Whichever library makes the second request will fail because TypedFetchProperty has been created against the other libraries copy of the event objects.
The text was updated successfully, but these errors were encountered:
I'm seeing this exact exception when deploying an Azure Function with the dotnet-isolated runtime. When can we expect a new version of the AppInsights package that contains the fix?
Actually I found that version 2.18.0-beta1 and up contain the fix! If you can't / don't want to use a beta version, the 2.18 milestone says to expect the 2.18 release on July 30th.
I currently use version 2.18-beta3 from Nuget (I had to select the "Include prerelease" checkbox in the Visual Studio Nuget UI), and it's working great :)
Describe the bug
Grpc.Net.Client raises events that HttpCoreDiagnosticSourceListener listens to. The problem is that
TypedFetchProperty
assumes that the type passed here will always be the same. Grpc.Net.Client has a copy of the types passed to the listener.ApplicationInsights-dotnet/WEB/Src/Common/PropertyFetcher.cs
Lines 46 to 49 in 81288f2
If
System.Net.Http
raises the events with one type, andGrpc.Net.Client
raises the events with a different type, thenTypedFetchProperty
throws an error.To Reproduce
With AI configured, make a web request with HttpClient, and make a gRPC request with Grpc.Net.Client.
Whichever library makes the second request will fail because
TypedFetchProperty
has been created against the other libraries copy of the event objects.The text was updated successfully, but these errors were encountered: