0

A call to the Windows phone 8 bluetooth api is not working in Windows 8. I'm getting the following exception:

System.InvalidOperationException' occurred in sampleunivapp.Windows.exe but was not handled in user code

WinRT information: FindAllPeersAsync cannot be called before Start

Additional information: A method was called at an unexpected time.

code

PeerFinder.AlternateIdentities["Bluetooth:Paired"] = string.Empty;                
var peerList =await PeerFinder.FindAllPeersAsync();

if (peerList.Count > 0)    
{    
    wpeername.Text = peerList[0].DisplayName;    
}    
else    
{    
    var msg=new MessageDialog("No active peers");

    msg.ShowAsync();
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
user925
  • 21
  • 5

0 Answers0