1

We are developing an application with .Net Core 3. However, one of our dependencies only supports UWP. Our plan so far has been to have a 'main' .Net Core 3 process for the bulk of our logic and a 'side' UWP process to connect to the library required.

Have so far investigated:

  • IPC (anonymous/named pipes), which doesn't work since UWP apps run in their own sandbox
  • App Services which should in theory work... but even so, they seem to rely on the UWP app being the 'host' as the connection is launched by the UWP specific FullTrustProcessLauncher.

In summary, is there some way of achieving a bidirectional relationship between a .Net Core 3 process and a UWP process, where .Net Core 3 is the 'parent' process?

1 Answers1

0

We are developing an application with .Net Core 3. However, one of our dependencies only supports UWP. Our plan so far has been to have a 'main' .Net Core 3 process for the bulk of our logic and a 'side' UWP process to connect to the library required.

In general, we have two ways that used to communicate within UWP platform. One is App Services that needs FullTrustProcessLauncher to run the app beofore uwp communicates with desktop app.

Another is Launch an app for results, New app-to-app communication APIs in Windows 10 make it possible for Windows apps (and Windows Web apps) to launch an app and exchange data and files. This enables you to build mash-up solutions from multiple apps. Using these new APIs, complex tasks that would have required the user to use multiple apps can now be handled seamlessly. For example, your app could launch a social networking app to choose a contact, or launch a checkout app to complete a payment process. You could launch UWP app from .Net Core 3 process then get reault.

Nico Zhu
  • 32,367
  • 2
  • 15
  • 36
  • I guess option 1 is to be ruled out since FullTrustProcessLauncher is UWP specific so can't be used from .NET Core 3.0. While the 2nd option might be promising. Needs to be proven though. – Hochman7G Nov 26 '19 at 14:35
  • if we want a .NET Core app to start and talk to a UWP Console app, then the tutorial doesn't seem to solve the problem. The tutorial is about the opposite scenario: launching an app from UWP because LaunchUriForResultsAsync works only in UWP - unless there's an equivalent of "Launch App for Results" in .NET Core 3.0 (which I can't seem to find). – Hochman7G Nov 26 '19 at 16:29
  • For using `LaunchUriForResultsAsync` api you need add Windwos.winmd lib to your project, you could find winmd file with this path `C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0`. – Nico Zhu Nov 27 '19 at 01:26
  • thanks - managed to get LaunchUriForResultsAsync to open UWP app from .NET Core 3.0 as you suggested. But this method only launches another app; it does not create a bi-directional communication channel between the two apps. Once the 2nd process launched, we want to be able to send information at any time from process 1 to 2 or vice versa. I think the only option left for us now is local sockets. – Hochman7G Nov 28 '19 at 19:12