Skip to content

Under what circumstances can ExecutionContext.Capture() return null? #83492

Answered by sakno
sakno asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, I see:

public static ExecutionContext? Capture()
{
ExecutionContext? executionContext = Thread.CurrentThread._executionContext;
if (executionContext == null)
{
executionContext = Default;
}
else if (executionContext.m_isFlowSuppressed)
{
executionContext = null;
}
return executionContext;
}

If flow is suppressed, then context is null.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sakno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant