Search Unity

Namespace errors when compiling Spectator View

Discussion in 'VR' started by darrenk80, Jan 9, 2020.

  1. darrenk80

    darrenk80

    Joined:
    Jul 16, 2019
    Posts:
    1
    Hi,
    I'm trying to get the Spectator View working for a Hololens project I'm working on. I'm following this guide and have followed all of the steps to get the repository and set up the environment. However, when I try to build the project I get the following error:

    Assets\MixedReality-SpectatorView\PhotoCapture\Scripts\HoloLensCamera.cs(1334,60): error CS0234: The type or namespace name 'Media' does not exist in the namespace 'Microsoft.Windows' (are you missing an assembly reference?)

    I've tried on versions 2018.4.14f1 and 2019.2.17f1 of unity, but still get the error. Does anyone know why this is happening?
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    407
    Hey,

    So the namespace "Microsoft.Windows.Media" isn't valid; it doesn't exist in .NET or WinRT.
    In this case, the correct namespace should just be "Windows.Media".

    I looked up the code location in GitHub reference by the error message, and the type being referenced is fully qualified Windows.Media.Devices.Core.CameraIntrinsics, and so I don't know where the "Microsoft" is coming from.

    I'd recommend asking about this problem on the MRTK Slack channel. If you're not already on it, you can join via this link: https://holodevelopersslack.azurewebsites.net/