Mixedrealitytoolkit-unity: MRC error in editor

Created on 23 Mar 2020  路  3Comments  路  Source: microsoft/MixedRealityToolkit-Unity

_I don't know if this is the right place to post my issue. If not, I kindly ask you to delete my thread as well and accept my apologies._

Describe the bug

Unity gives me error while VS doesn't, i've tryed to follow the steps from https://docs.microsoft.com/en-us/windows/mixed-reality/mixed-reality-capture-for-developers

To reproduce

  1. In VS try to reference the "HolographicDisplay" class
  2. Add the "using Windows.Graphics.Holographic" namespace
  3. See error in Unity editor while in VS is all ok

Expected behavior

Unity Editor reference correctly the namespace so i can try the MRC feature

Screenshots

Screenshot (56)
Screenshot (55)

Your setup

  • UWP
  • Unity Version 2019.2.21f1
  • MRTK Version v2.3.0
  • Visual Studio 2019
  • Windows SDK 18362

Target platform

  • HoloLens 2
Bug HoloLens 2

All 3 comments

Ah yes, since you're referencing an API in a Windows. namespace, this isn't callable by default in the Unity editor.

There's some info here about a plug-in you can import which adapts these APIs for use in-editor: https://docs.microsoft.com/en-us/windows/mixed-reality/using-the-windows-namespace-with-unity-apps-for-hololens#mixed-reality-apis

We also have built-in support for that plug-in in MRTK, but our NuGet importer (MSBuild for Unity) wasn't working well with Unity 2019 so we temporarily disabled it for the MRTK 2.3 release. If you import the plug-in manually using the steps linked above, you can use this setting if you add the correct #define.

Also, in response to

I don't know if this is the right place to post my issue.

these types of questions we typically look on StackOverflow for. That way, both questions and answers are more easily findable than in the issues list of a GitHub project.

Ah yes, since you're referencing an API in a Windows. namespace, this isn't callable by default in the Unity editor.

There's some info here about a plug-in you can import which adapts these APIs for use in-editor: https://docs.microsoft.com/en-us/windows/mixed-reality/using-the-windows-namespace-with-unity-apps-for-hololens#mixed-reality-apis

We also have built-in support for that plug-in in MRTK, but our NuGet importer (MSBuild for Unity) wasn't working well with Unity 2019 so we temporarily disabled it for the MRTK 2.3 release. If you import the plug-in manually using the steps linked above, you can use this setting if you add the correct #define.

Hi thank you, this solved my issue, yesterday i was working with the !UnityEngine_Editor properties, so building a new project each time, but now i can play and test my scripts also in play mode. Thank you :)

Was this page helpful?
0 / 5 - 0 ratings