Can't deploy UWP apps to HoloLens 2

Kevin Foley 6 Reputation points
2022-11-18T21:42:23.59+00:00

I am trying to deploy a simple 2D UWP XAML app (not a holographic app made with Unity/Unreal) to my HoloLens 2. This used to work, but recently deployment has only worked intermittently, and then stopped working altogether.

I have tried deploying from Visual Studio Community 2019 and Visual Studio Community 2022. When deployment fails, I get the error:

Error: Unable to connect to the Microsoft Visual Studio Remote Debugger named 'HOLOLENS-UC****'. The Visual Studio {2019/2022} Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.

The HL2 always shows up when I click "Find" from the debug settings menu:

262055-hl2-deployment-configuration.png

  • My HL2 is powered on and logged in
  • Developer Mode is enabled on both my development PC and the HL2
  • I have tried deploying both over USB and over Wifi, but deployment fails with the same error in either case.
  • The HL2 and my development PC are on the same network.
  • If I enable Device Portal, I can always access the HL2 from my PC's browser
  • Visual Studio is allowed through Windows Firewall
  • Deployment used to work correctly, and my network hardware has not changed
  • I have triple-checked that all required workloads/SDKs are installed, as described here
  • I have restarted my PC and the HL2 multiple times each
  • Factory-resetting the HL2 did not resolve the issue

Visual Studio Community: 2022 (17.4.1), 2019 (16.11.19)
HoloLens 2: Windows Holographic for Business 20348.1528
Development PC: Windows 10 Pro 22H2 19045.2251

Universal Windows Platform (UWP)
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,575 questions
HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
380 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
935 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Kevin Foley 6 Reputation points
    2022-11-23T02:58:33.957+00:00

    It seems like this issue was related to the OpenCV-Sharp, as removing their Nuget packages from the project fixed the deployment issue. We were testing the ARM version of OpenCV-Sharp, but perhaps it isn't compatible with the HoloLens 2. It's frustrating that the package caused deployment to fail with such a generic error message; there was no indication that OpenCV-Sharp was causing the issue.

    1 person found this answer helpful.
    0 comments No comments

  2. Zuocheng Wang - MSFT 3,081 Reputation points Microsoft Vendor
    2022-11-21T06:55:24.073+00:00

    Hello, Welcome to Microsoft Q&A,

    Currently, there are two ways to deploy apps to HoloLens.

    1. Deploy via WIFI/USB, the target is Remote Machine.
    2. Deploy via USB, the target is Device.
      It should be noted that when deploying to Remote Machine, it is recommended to manually enter the current HoloLens IP address in Manual Configuration->Address instead of depending on Auto Detected. And from the error message you provided, Visual Studio did not recognize the HoloLens device, please try to enter the IP address manually.
      If deploying to Remote Machine fails, you can try deploying to Device. This deployment method needs to be connected to your device with USB, and Visual Studio needs to install the component USB Device Connectivity.

    ----
    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.