Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

HttpClient 'Platform.AccessDeniedException'

Hi all,
my HttpClient is working in a UWP app but it fails inside a Hololense build:
Unhandled 'Platform.AccessDeniedException' exception caught! - Access denied

    Uri host = new Uri("http://foo/bar");
    var myClient = new HttpClient();
    string response = await myClient.GetStringAsync(host);

I'm using the Holo emulator. Edge has access to the internet.
Do I need some sort of permission?

Thanks.

Best Answer

  • Options
    Answer ✓

    @CauchY,
    It sounds like you need to enable internet capabilities for your application. To do this:

    • Go to Edit > Project Settings > Player
    • Select the Windows Store icon in the Inspector
    • Expand Publishing Settings and scroll down the Capabilities
    • Check InternetClient (and InternetClientServer if just InternetClient is not sufficient)

    Then build as usual in Unity and Visual Studio.

    Thanks!
    David

Answers

  • Options

    If I use the UnityWebRequest/WWW class, it works in Unity's Game mode. But it says "Cannot resolve destination host" in the HoloEmulator.

    Weird stuff is going on inside the Hololense. Everything works great until I try to use it with the Hololens.

  • Options
    Answer ✓

    @CauchY,
    It sounds like you need to enable internet capabilities for your application. To do this:

    • Go to Edit > Project Settings > Player
    • Select the Windows Store icon in the Inspector
    • Expand Publishing Settings and scroll down the Capabilities
    • Check InternetClient (and InternetClientServer if just InternetClient is not sufficient)

    Then build as usual in Unity and Visual Studio.

    Thanks!
    David

  • Options
    CauchYCauchY
    edited February 2017

    @DavidKlineMS
    Thanks for the tip, I didn't think about that.
    WWW works now.
    Unfortunately, awaiting the HttpClient still not working. I even disabled the firewall for testing.

Sign In or Register to comment.