Search Unity

UnityWebRequest not working when deployed to the HoloLens

Discussion in 'VR' started by Kuro_Ikari, May 23, 2018.

  1. Kuro_Ikari

    Kuro_Ikari

    Joined:
    May 23, 2018
    Posts:
    3
    Hey,

    I am quite new to Unity and the HoloLens, so excuse me if my question seems simple, but I've been trying to deploy an app to the HoloLens which includes calls to a WebAPI and the following issue has happened:

    Formerly, I used the HTTPWebRequest class for the requests to the API, but since it wouldn't allow me to build the solution, I ended up changing all of my HTTPWebRequest classes to UnityWebRequests instead.

    Now, basically, whenever I play the editor inside Unity it works perfectly, no issues, but when I deploy the project (via Visual Studio 2017), it gives me a "Cannot Connect to Destination Host" error, whether I deploy to Microsoft's HoloLens Emulator or to the HoloLens itself. They both have internet connection as well, so I'm not sure what might be the issue here.

    I've also activated the Networking Capabilities, both in Unity and VS2017 and it hasn't changed anything, and I've been searching around in the forums to no avail, so I would really be thankful for some help.
     
  2. ivan20071

    ivan20071

    Joined:
    Nov 15, 2017
    Posts:
    29
  3. Kuro_Ikari

    Kuro_Ikari

    Joined:
    May 23, 2018
    Posts:
    3
    Hey, I tried working with the solution you proposed, but it hasn't changed anything at all, and it still gives me the "Cannot Connect to Destination Host" error, and a message that just says "(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)" and I'm not quite sure what it means but it's not processing the web requests either way. I've also tried getting a request from a regular website like google but the same thing happens.
     
  4. Tragin

    Tragin

    Joined:
    Oct 3, 2016
    Posts:
    2
    What is the response code you receive? Make sure that you activate the InternetClient capability in the player settings.