Search code examples
c#wpfuwpdesktop-bridge

Connection status is "unknown" for AppService between UWP and WPF


I have a uwp app which uses an app service to communicate to the wpf app using desktop bridge. The app service works completely fine in my machine. But in some of the machines I am facing the following issue. When I try to launch the wpf app using await Windows.ApplicationModel.FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(); it launches successfully, but the connection status for connection.OpenAsync() is returned as AppServiceConnectionStatus.Unknown. I tried to find the reason for this but I didn't find anything. May I know what are the things which possibly cause the connection to fail? and what is the reason for this "unknown" status?

Also I just wanted to know what is the protocol used in app service to communicate between apps?

Sample Code in the wpf app:

        private static async void ThreadProc()
        {
            connection = new AppServiceConnection();
            connection.AppServiceName = "CommunicationService";
            connection.PackageFamilyName = Windows.ApplicationModel.Package.Current.Id.FamilyName;
            connection.RequestReceived += Connection_RequestReceived;

            AppServiceConnectionStatus status = await connection.OpenAsync();   //status is "unknown"

        }

Thanks in Advance :)


Solution

  • This issue might be related to anti-virus protection. Not sure what is blocked from the anti-virus protection that leads to the failure of the app services connection. If someone is facing this issue, please check the anti-virus protection first.