Describe the bug
I'm using Graph from an old 4.8.1 Framework project predating the async paradigm that has its own Multithreading backend. So i need to bridge the async/sync Barrier somehow and did that successfully with one exclusion. I have a seldom deadlock when iterating over graph results via calls to
await pageIterator.IterateAsync().ConfigureAwait(false);
and then at the some point bringing it back into my thread via .GetAwaiter().GetResult();.
Tried all known variants here to get that synchronized back. Wrapping calls in Task.Run writing my own SynchronizationContext (there shouldn't be one involved beforehand it is not a winforms application or something like that) etc. Nothing helped.
What worked for me in the end was adding a ConfigureAwait(false) in the PageIterator.IntrapageIterateAsync(CancellationToken) code when it calls _requestAdapter.SendAsync
and building the Graph.Core package myself.
Expected behavior
The PageIterator should not deadlock when used in certain contexts.
How to reproduce
Have a NET. Framework host application not written as "async all the way" try to concurrently retrieve data (like mailbox folder content from multiple mailboxes) that needs iterating and wait for a deadlock.
SDK Version
4.0.1
Latest version known to work for scenario above?
Don't use non async/await based code anymore. But i can't ;(
Known Workarounds
n/a
Debug output
n/a
Configuration
All currently supported Windows Desktop and Server Versions in x64 (presumably also x86 but have not tested)
Net. Framework 4.8.1
Presumably not specific to that configurations
Other information
No response
Describe the bug
I'm using Graph from an old 4.8.1 Framework project predating the async paradigm that has its own Multithreading backend. So i need to bridge the async/sync Barrier somehow and did that successfully with one exclusion. I have a seldom deadlock when iterating over graph results via calls to
await pageIterator.IterateAsync().ConfigureAwait(false);and then at the some point bringing it back into my thread via
.GetAwaiter().GetResult();.Tried all known variants here to get that synchronized back. Wrapping calls in Task.Run writing my own SynchronizationContext (there shouldn't be one involved beforehand it is not a winforms application or something like that) etc. Nothing helped.
What worked for me in the end was adding a
ConfigureAwait(false)in thePageIterator.IntrapageIterateAsync(CancellationToken)code when it calls_requestAdapter.SendAsyncand building the Graph.Core package myself.
Expected behavior
The PageIterator should not deadlock when used in certain contexts.
How to reproduce
Have a NET. Framework host application not written as "async all the way" try to concurrently retrieve data (like mailbox folder content from multiple mailboxes) that needs iterating and wait for a deadlock.
SDK Version
4.0.1
Latest version known to work for scenario above?
Don't use non async/await based code anymore. But i can't ;(
Known Workarounds
n/a
Debug output
n/a
Configuration
All currently supported Windows Desktop and Server Versions in x64 (presumably also x86 but have not tested)
Net. Framework 4.8.1
Presumably not specific to that configurations
Other information
No response