I'm running into what I think is a bug with
HttpClient and the asynchronous
ReadAsByteArrayAsync function. It's pretty simple: I have a button with an
async action that downloads a remote file using the
ReadAsByteArrayAsync function. The download seems to complete successfully every time, but the window containing the button disappears.
I've uploaded a sample project reproducing the bug here: https://github.com/tdenniston/XamAsyncDownloadBug
To reproduce the bug, run the application, click the button to show the download window, and then click the button to download the file asynchronously. Sometimes the window will disappear on its own, and sometimes it will disappear if, during the download, you click back to the main window.
Here are my system details:
Mac OS X 10.11.6
Darwin 15.6.0 Darwin Kernel Version 15.6.0
Visual Studio Community 2017 for Mac
Version 7.1 (build 1297)
Mono 18.104.22.168 (d15-3/da80840) (64-bit)
Apple Developer Tools
Xcode 8.2.1 (11766.1)
Version: 22.214.171.124 (Visual Studio Community)