I have a problem with OperationContext getting null after an async operation is called (and my threadid changes).
I know this is a know issue and I've gone threw some StackOverflow questions regarding the issue.
In .net 4.6.2 there is a fix for the issue as you can read here.
OperationContext.Current Async Improvements
WCF now has the ability to include OperationContext.Current with ExecutionContext so that the OperationContext flows through asynchronous continuations. With this improvement, WCF allows CurrentContext to propagate from one thread to another thread. This means that even if there’s a context switch between calls to OperationContext.Current, it’s value will flow correctly throughout the execution of the method.
Is there anything special I need to do in order to get this supported on my end? I'm using VS 2013, updated the framework to 4.6.2 and installed the dev-pack.
I've changed my project to use Framework 4.6.2 and I still get a null OperationContext after an async call.
The behavior that you're describing managed to make it into .NET 4.6.2 release and we're aware of it. In fact, we're in the process of rolling out a fix for this and I'm expecting it to be publicly available within the next couple of months.
For now the known workarounds are to revert to 4.6.1 version of the framework or to do something similar to this:
Please let us know if you have further questions or comments.