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
{{ message }}
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.
HTTP dependencies are not logged under the Desktop framework if the response has no content (as often happens with POST operations). Without this understanding of this limitation, it appears to be random.
This has been extremely painful to isolate. However, I've found by modifying the response with fiddler and making the response have some content, it properly logs the dependency call. Not sure what to do about our actual application though
Repro Steps
ASP.NET Core 2.1 application running under the desktop framework 4.7.1. App makes a POST call with HttpClient. Post call is successful with a content length of 0. No dependency logged in App Insights.
Exception thrown: 'System.InvalidCastException' in Microsoft.AI.DependencyCollector.dll ("Unable to cast object of type '<>f__AnonymousType3`3[System.Net.HttpWebRequest,System.Net.HttpStatusCode,System.Net.WebHeaderCollection]' to type '<>f__AnonymousType2`2[System.Net.HttpWebRequest,System.Net.HttpWebResponse]'."
This happens in TypedFetchProperty.Fetch invoked by the HttpDesktopDiagnosticsSourceListener. It appears that the object in the Diagnostics Source event is different than the type previously cached for the particular DiagnosticsSource event type.
Actual Behavior
No dependency event logged.
Expected Behavior
Dependency event logged.
Version Info
SDK Version : ApplicationInsights.AspNetCore 2.3.0
.NET Version : 4.7.1
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : VisualStudio
OS : Desktop or AzureAppService
Hosting Info (IIS/Azure WebApps/ etc) : Azpre App Service or local
The text was updated successfully, but these errors were encountered:
HTTP dependencies are not logged under the Desktop framework if the response has no content (as often happens with POST operations). Without this understanding of this limitation, it appears to be random.
This has been extremely painful to isolate. However, I've found by modifying the response with fiddler and making the response have some content, it properly logs the dependency call. Not sure what to do about our actual application though
Repro Steps
ASP.NET Core 2.1 application running under the desktop framework 4.7.1. App makes a POST call with HttpClient. Post call is successful with a content length of 0. No dependency logged in App Insights.
Exception thrown: 'System.InvalidCastException' in Microsoft.AI.DependencyCollector.dll ("Unable to cast object of type '<>f__AnonymousType3`3[System.Net.HttpWebRequest,System.Net.HttpStatusCode,System.Net.WebHeaderCollection]' to type '<>f__AnonymousType2`2[System.Net.HttpWebRequest,System.Net.HttpWebResponse]'."
This happens in TypedFetchProperty.Fetch invoked by the HttpDesktopDiagnosticsSourceListener. It appears that the object in the Diagnostics Source event is different than the type previously cached for the particular DiagnosticsSource event type.
Actual Behavior
No dependency event logged.
Expected Behavior
Dependency event logged.
Version Info
SDK Version : ApplicationInsights.AspNetCore 2.3.0
.NET Version : 4.7.1
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : VisualStudio
OS : Desktop or AzureAppService
Hosting Info (IIS/Azure WebApps/ etc) : Azpre App Service or local
The text was updated successfully, but these errors were encountered: