You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created an Unit Test App (UWP) referencing this library. The Unit Test app crashes to "Element not found" exception at this line in WindowsProvider.cs (method ShowAccountManagementPaneAsync):
pane = AccountsSettingsPane.GetForCurrentView();
The unit test app runs the tests with the following code:
I tried first wrapping the call Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments); with CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync, but it didn't solve the issue.
So I finally fixed this in WindowsProvider.GetTokenAsync by ensuring that AuthenticateInteractiveAsync is called from UI thread. As the method name suggests, there will be UI shown in the method. So it must be called from UI thread only:
publicoverrideasyncTask<string>GetTokenAsync(boolsilentOnly=false){...// Attempt to authenticate interactively.vartcs=newTaskCompletionSource<WebTokenRequestResult>();awaitCoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,async()=>{varresult=awaitAuthenticateInteractiveAsync(_scopes);tcs.SetResult(result);});authResult=awaittcs.Task;...
The text was updated successfully, but these errors were encountered:
Hello kinex, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
I have created an Unit Test App (UWP) referencing this library. The Unit Test app crashes to "Element not found" exception at this line in WindowsProvider.cs (method
ShowAccountManagementPaneAsync
):pane = AccountsSettingsPane.GetForCurrentView();
The unit test app runs the tests with the following code:
I tried first wrapping the call
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments);
withCoreApplication.MainView.CoreWindow.Dispatcher.RunAsync
, but it didn't solve the issue.So I finally fixed this in
WindowsProvider.GetTokenAsync
by ensuring thatAuthenticateInteractiveAsync
is called from UI thread. As the method name suggests, there will be UI shown in the method. So it must be called from UI thread only:The text was updated successfully, but these errors were encountered: