Search code examples
windows-runtimemicrosoft-metrowinrt-xamlwns

How to resolve exception : The wait operation timed out. (Exception from HRESULT: 0x80070102)


I am getting this exception when calling PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); method. It is working fine on Device, but fails on Local Machine.

This is my code :

private async void CreateChannel_Click(object sender, RoutedEventArgs e)
       {
var vProfile = NetworkInformation.GetInternetConnectionProfile();
            System.Diagnostics.Debug.WriteLine("InterNetConnectivity==>>" + vProfile.GetNetworkConnectivityLevel().ToString());
            UserResponseTBL.Text = vProfile.GetNetworkConnectivityLevel().ToString();
            if (vProfile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess)
            {
                var vChannel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
                string channelUri = vChannel.Uri;
                UserResponseTBL.Text = channelUri;
                System.Diagnostics.Debug.WriteLine("channelUri : " + channelUri);
            }
        }

I am getting the exception The wait operation timed out. (Exception from HRESULT: 0x80070102). Any help would be appriciated. Thanx


Solution

  • I have resolved the problem by running the above code on device/different machine.

    This problem occurred because I have installed various versions of Visual Studios on my machine. Don't know the actual cause of this problem but it works when I upgraded my machine to windows 10.