Domanda

I just started playing with bluetooth communication on WP8. I found a example here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207007(v=vs.105).aspx

But as soon as Peerfinder.Start() is hit, i get this error: A first chance exception of type 'System.UnauthorizedAccessException' occurred in PhoneApp3.DLL

public MainPage()
{
    InitializeComponent();
    PeerFinder.Start();
}

async private void AppToApp_Click(object sender, RoutedEventArgs e)
{
    // PeerFinder.Start() is used to advertise our presence so that peers can find us. 
    // It must always be called before FindAllPeersAsync.
    var peers = await PeerFinder.FindAllPeersAsync();

    if (peers.Count == 0)
    {
        Debug.WriteLine("Peer not found.");
    }
    else
    {
        Debug.WriteLine(peers.Count + " peers found");
    }
}
È stato utile?

Soluzione

Make sure you've added the capabilities ID_CAP_PROXIMITY and ID_CAP_NETWORKING to your application manifest.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top