Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packaged App]co_await does't return to ui thread. when the call PickSingleFolderAsync is completed #1782

Closed
shelllet opened this issue Nov 12, 2021 · 3 comments
Assignees
Labels
bug Something isn't working servicing-consider v1.0.0-preview3 Bugs affecting 1.0 Preview 3
Milestone

Comments

@shelllet
Copy link

shelllet commented Nov 12, 2021

Describe the bug

Internal bug https://task.ms/37013204

windowsappsdk preivew-3:
StorageFolder folder = co_await picker.PickSingleFolderAsync();

at this point

call DependencyObject::SetValue throw errors.

The application called an interface that was marshalled for a different thread
//

Steps to reproduce the bug

  1. Create c++ package app by windowsappsdk.

  2. Call FolderPicker to open select folder dialog on button clicked event.

  3. then DependencyObject::SetValue

Expected behavior

before windowsappsdk preview-3

c++/winrt will restore to ui thread automatically.

why preview-3 change this ?

Screenshots

image

NuGet package version

1.0.0-preview3

Packaging type

Packaged (MSIX)

Windows version

Windows 11 (22000)

IDE

Visual Studio 2022

Additional context

to avoid me bebing wrong, I recreate an empty pacakged project and test .

image

image

unpackaged app:
image

@shelllet shelllet changed the title winrt will not restore to ui thread. when finished to call PickSingleFolderAsync co_await does't return to ui thread. when the call PickSingleFolderAsync is completed Nov 15, 2021
@shelllet shelllet changed the title co_await does't return to ui thread. when the call PickSingleFolderAsync is completed [Packaged App]co_await does't return to ui thread. when the call PickSingleFolderAsync is completed Nov 15, 2021
@andrewleader
Copy link
Contributor

@BenJKuhn @Scottj1s would this co_await issue be either of your areas of expertise? It sounds like in Preview 3 we possibly regressed the behavior of co_await in C++ apps and it doesn't return back to the UI thread anymore?

@andrewleader andrewleader added bug Something isn't working v1.0.0-preview3 Bugs affecting 1.0 Preview 3 labels Nov 15, 2021
@andrewleader
Copy link
Contributor

@BenJKuhn this looks like a dupe of https://microsoft.visualstudio.com/OS/_workitems/edit/37013204 which @MikeHillberg is assigned to. @MikeHillberg is this indeed a dupe of your co_await bug?

@andrewleader andrewleader added this to the 1.0.1 milestone Nov 16, 2021
@BenJKuhn BenJKuhn modified the milestones: 1.0.1, 1.1 Feb 8, 2022
@BenJKuhn
Copy link
Member

This was fixed some time ago (in 1.0, I believe), but the public issue never got closed out. Just cleaning up books.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working servicing-consider v1.0.0-preview3 Bugs affecting 1.0 Preview 3
Projects
None yet
Development

No branches or pull requests

3 participants