microsoft / microsoft/WindowsAppSDK

ContactPicker InvalidOperationException

Open
#1,157 7 comments 1 reaction 1 assignee Assigned to @angelazhangmsft View on GitHub
bug
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

**Describe the bug**

I am using ProjectReunion 0.8.1 on a Desktop app. When using the ContactPicker, I am getting an InvalidOperationException. This is for a UWP app that we are testing to port to WinUI Desktop. Any help or guidance is appreciated. Thanks.

**Steps to reproduce the bug**

ContactStore contactStore = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
Windows.ApplicationModel.Contacts.ContactPicker page = new Windows.ApplicationModel.Contacts.ContactPicker();
page.SelectionMode = ContactSelectionMode.Contacts;
var contacts = await page.PickContactsAsync();

**Expected behavior**
ContactPicker to launch

**Error**
System.InvalidOperationException
HResult=0x80131509
Message=Exception of type 'System.InvalidOperationException' was thrown.
Source=WinRT.Runtime
StackTrace:
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Windows.ApplicationModel.Contacts.IContactPicker2.global::Windows.ApplicationModel.Contacts.IContactPicker2.PickContactsAsync()
at Windows.ApplicationModel.Contacts.ContactPicker.PickContactsAsync()
at App4.MainWindow.d__5.MoveNext() in C:\Users\james\source\repos\App4\App4\App4\MainWindow.xaml.cs:line 64

onecoreuap\shell\windows.system.launcher\lib\windows.system.launcher.cpp(1659)\Windows.System.Launcher.dll!18620262: (caller: 7A608038) Exception(1) tid(3ff4) 8000000E A method was called at an unexpected time.
Exception thrown at 0x760EB4B2 in App4.exe: Microsoft C++ exception: wil::ResultException at memory location 0x02F7AEE0.
Exception thrown at 0x760EB4B2 in App4.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
onecoreuap\shell\windows.system.launcher\lib\windows.system.launcher.cpp(1676)\Windows.System.Launcher.dll!18620230: (caller: 7A608038) ReturnHr(1) tid(3ff4) 8000000E A method was called at an unexpected time.
Msg:[onecoreuap\shell\windows.system.launcher\lib\windows.system.launcher.cpp(1659)\Windows.System.Launcher.dll!18620262: (caller: 7A608038) Exception(1) tid(3ff4) 8000000E A method was called at an unexpected time.
]
Exception thrown: 'System.InvalidOperationException' in WinRT.Runtime.dll

**Version Info**
ProjectReunion 0.8.1

| Windows 10 version | Saw the problem? |
| :--------------------------------- | :-------------------- |
| May 2020 Update (19041) | Yes |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.