I am using async/await pattern in .NET 4.5 to implement some service methods in WCF. Example service:
Contract:
[ServiceContract(Namespace = \"http:/
I think your best option is to actually capture it and pass it manually. You may find this improves the testability of your code.
That said, there are a couple of other options:
LogicalCallContext
.SynchronizationContext
which will set OperationContext.Current
when it does a Post
; this is how ASP.NET preserves its HttpContext.Current
.TaskScheduler
which sets OperationContext.Current
.You may also want to raise this issue on Microsoft Connect.