UWP Application Communication with Windows Service

We fix the archiving of the application and discuss whether it is possible to use UWP instead of a regular WPF application.

Our application must have access to the entire file system and all system resources. This is a problem because UWP applications are sandboxed. However, we are trying to get around this problem by trying to approach it this way:

  • Windows Service β†’ Works on the system at any time. This will provide basic functionality when it comes to accessing and modifying system resources.

  • UWP application β†’ Since UWP is sandboxed, the UWP application forwards all system requests to the Windows service, which will do everything from the main work and simply return the result.

We can just do this in WPF, but we would like to use UWP to use some of the new core features of Windows 10 that lack WPF, such as live snippets and Cortana.

Do you think our approach is possible? One of our uncertainties is how we can get the UWP application to interact with the Windows Service - we looked at things like SignalR and Desktop Bridge, but are not sure what might be the best approach for our scenario.

Thanks!

+5
source share
1 answer

Do you think our approach is possible?

We cannot use the Windows service directly in the UWP application. To make IPC between the Win32 application and the UWP application, which can help here use the new Capability <rescap:Capability Name="runFullTrust" /> , and it includes the Win32 application launched by the FullTrustProcessLauncher API to reach the application's security context up to consume WinRT API But, as you see here rescap , this means that this UWP app cannot be published in the store.

You can refer to the official Example AppService Bridge . You can first create a traditional desktop application that consumes an application service (which can communicate with a WPF and UWP application, and not with a traditional Windows service) and use the WinRT APIs after creating this application (do not run it), a file will be created. exe. But this application cannot work, since it uses the WinRT API, then you can create your own UWP application to make this application for desktop applications.

We looked at things like SignalR and Desktop Bridge, but are not sure what might be the best approach for our scenario.

So, I think a desktop bridge might be the best approach here.

+1
source

Source: https://habr.com/ru/post/1259560/


All Articles