Hi, Shervan360
Update:
The problem you are having is similar to this Why Task.CurrentId becomes NULL after Task.Delay:
Only Delegate tasks have
CurrentId
set. So the ID you're seeing is not the ID of the task returned fromSomeMethod
(you can verify this by checking the ID on the task returned fromSomeMethod
). It's the ID of just the first block of synchronous code. The rest of the blocks (the continuations) are run directly on the thread pool and are not wrapped in tasks, so there is noCurrentId
for them.
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.