Search Unity

View Switching COM Exception on HoloLens Emulator

Discussion in 'VR' started by GodzillaSpider, Sep 19, 2018.

  1. GodzillaSpider

    GodzillaSpider

    Joined:
    Feb 21, 2018
    Posts:
    11
    Hello All,

    I have an app with 2 views: a 3D view using Unity and a 2D view with a WebView. When trying to switch between the views on the HoloLens Emulator version 10.0.17134.80, I get the following exception:

    System.Runtime.InteropServices.COMException: 'Error HRESULT E_FAIL has been returned from a call to a COM component.'

    The line that returns this exception is:

    Code (csharp):
    1.  
    2. await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
    3. {
    4. await ApplicationViewSwitcher.SwitchAsync(this.view.Id); //<-- EXCEPTION
    5.  });
    6.  
    The same exact code works fine on HoloLens emulator version 10.0.14393.1358

    Does anyone know if there is some setting or permission that I need on the newer version? Otherwise, can anyone explain how to troubleshoot this cryptic COMException? The message isn't giving me much to go on.
     
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
  3. GodzillaSpider

    GodzillaSpider

    Joined:
    Feb 21, 2018
    Posts:
    11
    Hey Jason, thanks for the reply.

    I think this is likely a UWP issue because the same code works on the Emulator version 10.0.14393.1358. For the same reason, I think there is no issue of which view/thread the dispatcher is on. I'm guessing it's some kind of new UWP security/privacy measure that's not allowing apps to switch views. It may be that I need to specify some required capability or something like that.

    I've opened up a ticket with Microsoft as well so we'll see what they say.
     
    JasonCostanza likes this.
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Yep I was afraid of that, I THINK this is a Microsoft issue you're experiencing. Hopefully their support team can reach you quickly
     
  5. jbienzms

    jbienzms

    Microsoft Employee

    Joined:
    May 23, 2018
    Posts:
    1
    Hey @GodzillaSpider, my name is Jared. I work at Microsoft and I regularly help customers build WMR / HoloLens apps. Your browser implementation could be super helpful to some customers I work with and I'm wondering if you ever got this bug resolved? If not, maybe I can help find the right people to look into it.

    I didn't see any contact information on your website, so if you're still seeing the problem can you e-mail me? My address is jbienz###<at>###microsoft#<dot>#com. (Just remove all the number signs.)
     
    JasonCostanza likes this.