Search code examples
deploymentuwpvisual-studio-2019hololenswindows-mixed-reality

Error when deploying solution to HoloLens 2


I want to develop for the HoloLens 2. To learn how to setup everything and how to deploy an app, I followed this youtube tutorial: https://www.youtube.com/watch?v=BymWq0vzBhM. However, when I try to deploy my solution, I get the following error:

DEP6957: Failed to connect to device '127.0.0.1' using Universal Authentication. Please verify the correct remote authentication mode is specified in the project debug settings. COMException - No connection could be made because the target machine actively refused it. (Exception from HRESULT: 0x8007274D) [0x8007274D]

The Hololens 2 is turned on and connected with a USB cable to the PC and shows up in the device manager under portable devices. Developer mode is turned on the HoloLens 2.

This is the detailed description of my steps:

  • installed Unity 2020.3.13f1 with Microsoft Visual Studio Community 2019, Universal Windows Platform Build Support, and Windows Build Support (IL2CPP)
  • created new project
  • in build settings: switched to Universal Windows Platform and selected HoloLens as target device, ARM64 as architechture and Build and run on USB Device
  • downloaded mixed reality feature tool and got the following features: Mixed Reality Toolkit Foundation, Mixed Reality OpenXR Plugin, and Mixed reality Toolkit Standard Assets
  • went through MRTK project configurator:
    • Chose Unity OpenXR plugin (recommended)
    • in XR Plug-in Management checked OpenXR and Microsoft HoloLens feature group, fixed all issues in project validation, added Eye Gaze and Microsoft Hand interaction profiles, change depth submission mode to depth 16 Bit)
    • apply recommended project settings, fixed all issues, edited main camera to have a clear background color, a solid color clear flag and a TrackedPoseDriver component
    • Apply all Default Settings
    • Import TMP Essentials
  • project settings -> player: changed package name and product name
  • mixed reality -> toolkit -> add to scene and configure
  • added cube to scene
  • build project in unity
  • make sure developer mode is activated on HoloLens
  • connect hololens 2 with PC through a USB cable and check in device manager -> Portable devices that Hololens is connected properly
  • open solution in Visual Studio Community 2019 and slect: Release, ARM64, Device
  • build -> deploy solution

Solution

  • check if "USB device connectivity" is installed in the VS installer. If not, install it and try deploying again. enter image description here