There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
ContextItems not flowing across Async Methods
In one of our projects we are using ContextItems in the Logging Block to populate additional properties in the LogEntry.
It all works fine in synchronous scenarios. But in async scenarios like async/await oder in async callbacks from WCF Services the ContextItems are lost.
Is this by design?
In the source I have found that the ContextItems use the remoting CallContext. But it doesn't use the LogicalCallContext which is also transported across threads.
What is the best solution for this problem? Since the async programming model is much easier in .NET 4.5 there should be a need for a fix for this, shouldn't it?