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

HTTP Dependencies not tracked for 0 content-length results under Desktop Framework #929

Closed
chriswelles opened this issue May 31, 2018 · 3 comments

Comments

@chriswelles
Copy link

chriswelles commented May 31, 2018

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

@lmolkova
Copy link
Member

Thanks for reporting it, I believe we fixed it few days ago: #919

@zell12
Copy link

zell12 commented Jun 9, 2018

Could this be a related issue? See attached screenshot.
image

@chriswelles
Copy link
Author

Looks like the same issue to me.

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

No branches or pull requests

3 participants