Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Tutorial: Debugging with Holograms 211 with update code library

Jimbohalo10Jimbohalo10 ✭✭✭
edited May 2016 in Discussion

Debugging with Holograms 211 with updated code library
code was updated 11 May 2016

https://developer.microsoft.com/en-us/windows/holographic/holograms_211 tutorial

Download the most recent copy from the link in article or updated 211 Gestures code
Or https://github.com/Microsoft/HolographicAcademy/archive/Holograms-211-Gesture.zip

Unpack this to a smaller path, for example “C:\v\Holo-211-Gesture11may2016”, to avoid any problems with long path names.
Follow instructions given in holograms_211 page above to install all the software required.
Follow instructions on how to pair your HoloLens device to you PC, for development.

Open Unity Click open and navigate to Completed\ModelExplorer. Select Open, acknowledge the Unity Package conversion message, Yes/OK.
When the Main Page Screen is displayed in the Project box on the left, look in Assets, for Scenes. Click on Scenes icon and this displays a Unity Icon with ModelExplorer. Double click this to install the scene. Now File ->Save Scene, File ->Save Project.
For debugging this application
In Unity File -> Build Settings

Setting is Windows Store SDK = Universal 10, UWP Build Type = XAML, Local Machine, Debugging Unity C# Projects = ticked, YES, Development Build = ticked, YES
Click “Switch Platform”.
Next Click “Player Settings”, Scroll down to Publishing and click.
Check you have the following ticked

You will need to tick Microphone as well, if you don’t you cannot give any keyword commands to debug build.
Click “Build” in the build setting. File explorer windows pops up and now right click white space and select New -> Folder and give the name “AppDebug”. The folder is created “Select Folder” the AppDebug folder and the build starts. When the build is successfully completed, a New File Explorer desktop window opens. Open AppDebug folder and double click ModelExplorer Visual Studio Solution.
Visual Studio will now open
First thing to do there is a problem to be fixed, to "Enable Just My Code" needs to be disabled (unchecked) in Visual Studio under Tools->Options->Debugging in order to hit breakpoints in your code.

Select the build “Master, x86, Local Machine”, shown below, to make sure everything we need is loaded automatically.

Right Click ModelExplorer (Universal Windows), Build. This will take a few minutes as VS 2015 has a lot of work to do in background, which saves developers time later.
Select Debug and for the HoloLens device Click the drop-down arrow on the right of 'x86', and select Remote Machine. This assumes you have already set up the HoloLens device from previous tutorials
Enter or check your device IP address and set Authentication Mode to Universal (Unencrypted Protocol). Click Select.
If you are using the HoloLens Emulator, Select Debug, select the HoloLens Emulator from the drop-down arrow on the right of 'x86', the bottom of the list.
Right Click ModelExplorer (Universal Windows), Build. This will take a while as VS 2015 has a lot of work to do in background, which saves developers time later.
Hopefully you got a “Build Succeeded” in the left hand side.
Next have to “File Menu Build -> Deploy Solution”, wait for “Deployment Successful”.

Now start Debugging. This slightly different for each Remote Device (HoloLens) and HoloLens Emulator.
The Remote Device (HoloLens) will quickly respond, the HoloLens Emulator, if not loaded will take some time.
The Debugger will start the ModelExplorer app in both cases and you will need to “Tap” to get past the start page.
I have started the ModelExplorer app and now moved back to the main screen of VS 2015

I have clicked the Blue “Break All” button to stop debugging.
I have called up GazeManager.cs, from Solution Explorer, right clicked on line 73 the If (Hit) statement, and inserted a break point. I have clicked “Continue” below Menu bar and immediately hit the breakpoint.
The picture shows the VS 2015 cursor over on line 73 the If (Hit) statement, showing the value of Hit to be false.
In the VS 2015 Output window you can see the information log messages being sent from the HoloLens Library functions for you to see the tracking state as the application runs.
Remove the break point at line 73 and
put a break point at line 77 “Position = hitInfo.point;”, as the application run would only break on “If raycast hit a hologram...” described in comments.

When you have finished debug and want the performance then rebuild a “Release” version using the information in the document

Note that you cannot debug using the “Release” build, as described in the document, does NOT have debug code and VS 2015 and Unity require separate directories for AppDebug and AppRelease.

Finally, if you see problems with “OnGazeEnter/OnGazeLeave” You are using old HoloLens Library code.

The "SendMessage" method is obsolete, download the tutorial again or the HoloLens library and check the files in the zip are date AFTER 11-May-2016


  • I just tried this, but I get the following error:

    The program '[4764] ModelExplorer.exe' has exited with code 255 (0xff).

    Any ideas on how to fix this?

  • @holoben said:
    I just tried this, but I get the following error:

    The program '[4764] ModelExplorer.exe' has exited with code 255 (0xff).

    Any ideas on how to fix this?

    This error occurs as result of running on the Local Machine, and executing HoloLens code from the "Master, x86, Local Machine" build

    I should have added "Don't run this". When completed build using
    "Debug,X86, HoloLens Emulator", then Deploy Soloution

  • It might be you are using 'Master' or' Debug' instead of 'Release'..?

  • Lots of people seem to have trouble connecting the HoloLens emulator to the internet so here is a good help link Connecting-The-HoloLens-Emulator-To-the-Internet

Sign In or Register to comment.