microsoft / ApplicationInsights-SDK-Labs

Application Insights experimental projects repository
MIT License
61 stars 48 forks source link

WCF: Flow context on async calls #68

Closed tomasr closed 8 years ago

tomasr commented 8 years ago

This is not a problem on .NET 4.6.2, where WCF correctly flows the OperationContext across async calls.

The fix for 4.5 - 4.6.1 would be to use AsyncLocal<T> to capture a reference to WcfOperationContext, but this is only supported in .NET 4.6, not 4.5.

So switching to use the LogicallCallContext as a work around, which should work on all of these. This should improve https://github.com/Microsoft/ApplicationInsights-SDK-Labs/issues/65

tomasr commented 8 years ago

@SergeyKanzhelev Any chance you can merge this one whenever you can?

SergeyKanzhelev commented 8 years ago

Sorry for delay merging it