Trying to use new C# 5 async model it was surprising to me AspNetSynchronizationContext
is an internal class (as well as AspNetSynchronizationContextBase
base). Thus undocumented. But it's essential to know what it does when utilizing async/await feature within your ASP.NET code. Am I correct that
It does guarantee your continuations will get the same HttpContext.Current
as original callers?
It does not guarantee the continuations will execute on the same thread as the callers?
If the latter assumption is not true and I get the original thread can I be sure to get the same thread context in continuations? I mean principal/culture associated with the thread and thread local storage? That's important because ASP.NET localization relies on thread's culture and my application relies on .NET role security model (thread's principal).