Can't open uwp app with Launcher.LaunchUriForResultsAsync from wpf app (System.InvalidOperationException)

0

I have wpf app from which I would like to open uwp app and get some data from it. It is working fine when using LaunchUriAsync

private async void Button_Click(object sender, RoutedEventArgs e)
{
   Uri uri = new Uri("sample.app:");
   await Launcher.LaunchUriAsync(uri);
}

but when I use method LaunchUriForResultsAsync like this:

private async void Button_Click(object sender, RoutedEventArgs e)
{
   var options = new LauncherOptions();
   options.TargetApplicationPackageFamilyName = "test.tablet.show_87sq1n958t6qj";
   Uri uri = new Uri("sample.app:");
   var result = await Launcher.LaunchUriForResultsAsync(uri, options);
}

I get

System.InvalidOperationException: 'A method was called at an unexpected time. (0x8000000E)'

Any ideas what I am missing ? :)

c#
.net
wpf
uwp
asked on Stack Overflow Dec 9, 2019 by Greaver

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0