microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

windows.appService extension doesn't work with WinUI3 #9838

Open bkaankose opened 1 month ago

bkaankose commented 1 month ago

Describe the bug

Below definition in package manifest is enough for UWP apps:

<uap:Extension Category="windows.appService">
    <uap:AppService Name="MyAppServiceName" />
</uap:Extension>

This results in the following error with packaging WinUI3 apps when launching (build is fine)

image

image

(Full Trust parts are deducted from the bug report since for WinUI it's not needed. I can launch my server process without using full trust launcher)

Working solution

1- UWP App (Client) 2- WPF App (Server) 3- Packaging project (wapproj)

Non-Working Solution

1- WinUI3 App targeting Windows (Client) 2- WinUI3 App targeting Windows (Server) 3- Packaging project (wapproj)

Questions

1) Is windows.appService extension even supported for Windows apps to be used in package.manifest? 2) I noticed that FullTrustProcessLauncher also throws COMException when launched with no details. Is it supported as well?

I understand that there are other IPC options with WinUI, but I have already working solution with AppServiceConnection. I'd like to use that instead of creating a new solution.

Steps to reproduce the bug

1) Create 2 different WinUI 3 apps for Windows. 2) Create packaging project and bundle them together. 3) Define Application extension in the description above to packaging project's manifest file. 4) Build is fine, but launching you receive errors in Visual Studio.

Expected behavior

App Service must be registered to package for both applications to connect.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

Windows version

Windows 11 (22H2): Build 22621

Additional context

Defining EntryPoint or StartupPage to extension makes the app launch, but AppServiceConnection never connects. Always return AppServiceNotAvailable status.

Osirisoo0O commented 1 month ago

https://github.com/Osirisoo0O/WASDKSample I hope it's helpful