C# App hangs when BitmapDecoder.CreateAsync is called

C# App hangs when BitmapDecoder.CreateAsync is called

Calling ASync functions from UI event handling routines/the main UI thread in C# turns out to require some basic knowledge to avoid getting into deadlocks. I sort of jumped in without doing much learning, so here were some of my learning resources as I made the inevitable mistakes:

https://stackoverflow.com/questions/12507749/winrt-app-hangs-when-bitmapdecoder-createasyncstream-is-called

https://social.msdn.microsoft.com/Forums/en-US/8bed034e-a8f6-4322-a801-79f014815dd9/bitmapencodercreateasync-never-returns?forum=winappswithcsharp

https://stackoverflow.com/questions/12235085/winrt-loading-static-data-with-getfilefromapplicationuriasync

Debugging tips:

https://medium.com/bynder-tech/c-why-you-should-use-configureawait-false-in-your-library-code-d7837dce3d7f

https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1.result?view=netframework-4.8

C# and Universal Windows App file handling:

https://docs.microsoft.com/en-us/windows/uwp/get-started/fileio-learning-track

https://docs.microsoft.com/en-us/windows/uwp/files/file-access-permissions

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.