-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Description
When the AppName getter calls result.Task.Wait(), this blocks the calling thread, which is the UI thread in this case. When the await Package.Current.InstalledLocation.GetFileAsync("AppxManifest.xml") call finishes, it will attempt to run its continuation on the UI thread, but this thread is blocked waiting for the toRun method to finish, which results in a deadlock.
This is better explained here: http://stackoverflow.com/questions/11316438/call-to-await-getfileasync-never-returns-and-app-hangs-in-winrt-app (see Stephen Cleary's answer).
I see that this pattern is implemented in many property getters throughout the SDK and is a potential deadlock source. I think async methods should be used instead of readonly properties in these cases.