Category Archives

Live blogging the Microsoft Build keynote, day 1 #msbuild

.NET, Build, Conferences, HoloLens, Technical stuff, Universal Windows Platform UWP, Visual Studio, Windows 10, Work, Xamarin, XAML
No Comments

Build day 1 is a wrap and you can find all the live notes taken during the keynote in this post!

A good start in 2017: NDC London and a World of Devices

HoloLens, MicrosoftBand, NDC, Technical stuff, Work
No Comments

Sorry for the late post, I wanted to post this earlier but then a lot happened (getting sick didn’t help and a trip to Kansas City where I am typing this from).

Last Wednesday I flew to London City airport to speak at the first conference of the year: NDC London. The Norwegian Developer Conference started in Oslo but quickly expanded to other locations. I spoke at NDC a few times but I had not been able to speak there for a while. I was happy that the organizers and I could agree on a topic that drew a respectable crowd of nice people coming to hear me talk about A World of Devices. All the documents are here!

This talk is a little different than my usual talks. No code! but a lot of anecdotes from my past as a (huge) geek, who tried most devices that attracted my attention for the past 20+ years. For me it all started when I got a Casio device in which I could store my contacts and calendar information. There was little to no connectivity (this was before I even went online). Then I seriously considered purchasing a Newton! I even went to the store to see it and really hesitated. I loved the handwriting recognition. I really wanted one but I just couldn’t pay for it, no way. Later, my dream came true: I bought a Palm Professional. This was the second generation of Palm devices. I had to order it specially from a US website (in the mean time I had gotten internet access at work and then at home). I can’t say how much I loved this device and the many Palm devices I bought after that. I became super proficient in Graffiti handwriting, so much so that even started writing this way on paper (the Ts were particularly funny).

There are a lot of anecdotes from these pioneer times (like my first mobile internet connection, which I got from my Palm to a Siemens mobile phone through the Infrared port and then to the mobile network. It took ages to negotiate the handshakes and of course typically as soon as you were connected something happened and the IR connection would get cut, for example a bump in the railroad or something similar).

I drew on this experience and all the other amazing devices I either used or coded for (or both) to prepare what I think is an informative and interesting session with a lot of demos: Cortana; Inter-device communication (Microsoft Band connecting through Bluetooth to a PC and controlling a 3D scene thanks to the Accelerometer sensor); Windows Continuum; and of course Microsoft HoloLens.

Thanks to everyone who came by, I really appreciated your presence. Thanks also to everyone who came later to speak to me regarding MVVM Light, WPF, Silverlight, Xamarin or any other topic. It’s always such a pleasure to connect with people all around the world and have interesting discussions.

As always, I created a page on my website for this presentation. There you will find the slides, the link to the Her trailer video as well as the GitHub repo for the Microsoft Band sample.

Happy coding and happy 2017!

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

Le matériel pour ma présentation “HoloLens 101” du DevDay à Mons

Conferences, HoloLens, Personal, Technical stuff, Work
No Comments

J’ai eu beaucoup de plaisir à participer à l’événement DevDay à Mons en Belgique. Cela fait déjà quelque temps qu’Olivier Matis me demande de participer, et malheureusement cela n’avait pas été possible pour des questions de temps. Enfin cette année j’ai pu dire oui. Connaissant au moins certains membres de l’équipe organisatrice, je me réjouissais vraiment de faire le voyage pour cette ville que je ne connaissais pas encore.

Après un court vol et une heure en train, je me suis donc retrouvé dans cette ville dont le nom signifie « montagne », ce qui est assez drôle pour un Suisse. Très jolie ville, que j’ai traversée à pied dans un froid de canard, mais en admirant la cathédrale et la place centrale avec l’hôtel de ville. Au soir, souper avec certains des speakers et organisateurs, dans une super ambiance, et avec de la bonne bière.

Le lendemain, j’avais l’honneur de donner la première session dans une salle de cinéma à l’écran géant, une chouette expérience pour un speaker. Quelques soucis de micro, et un peu de stress parce que j’ai décidé de donner la session en français… Ca peut paraître drôle mais je n’ai pas l’habitude de parler de programmation en français… d’habitude c’est l’anglais, voire l’allemand.

Au final, tout s’est bien passé, et j’ai pu montrer les différences entre VR, AR, MR, parler de l’environnement de développement, et montrer une démo d’une petite appli commencée depuis zéro, pour donner un petit peu le goût de la programmation 3D. Enfin, j’ai fini la session avec des démos d’applications que nous développons pour des clients.

La fin de la journée s’est passée à faire des démos HoloLens et discuter avec plein de monde dans une super ambiance. Un petit tour en Tesla X de démonstration avant de reprendre le train et l’avion…

Un grand merci aux organisateurs pour l’invitation et le super travail sur place, ainsi bien sûr aux nombreux spectateurs qui sont venus assister à la session et me parler par la suite.

Vous trouverez le fichier PowerPoint, le code ainsi que quelques vidéos de démonstration sur mon site.

Amitiés à tous

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

Code and slides posted for my latest talks

.NET, Conferences, HoloLens, MVVM, Technical stuff, Universal Windows Platform UWP, UX, Windows 10, Work, Xamarin, XAML
No Comments

October and November have been quite busy with travel. I talked at a few occasions in some cool events and want to take a moment to share the code and slides below:

Xamarin Dev Day, Zurich, Switzerland

I love the concept of the Xamarin Dev Day. It’s a great way to reach out to local communities and have a day of fun teaching and training with Xamarin content. This year I took part to the Zurich, Switzerland occurrence. It definitely didn’t hurt that it was help in a very cool space, under a train viaduct in the previously industrial area of the city, which is these days a pretty cool place to live and work.

I held my talk titled “Building truly cross platform applications with Windows, Xamarin and MVVM Light” which comments on the fact that the so called “UWP” (Universal Windows Platform) applications are only for Windows (hence the W) and that if you want to target mobile iOS and Android devices, you need something more. Xamarin and MVVM Light are great solutions in this scenario, because they maximize the amount of code that can be shared, all the while increasing the testable surface of the application. You can find the code and slides at this page.

KC .NET User Group & Xamarin KC Dev, Kansas City, Missouri

You might have read that the company I joined in 2008 (IdentityMine) was acquired this year by a company based in Kansas City named Valorem Consulting. On November 1st and 2nd, I spent time at the head office to meet with a maximum of new colleagues. It was a nice stay in a city (and state) I had never visited before. In fact I even “visited” two states during that stay, because Kansas City is laid over Missouri and Kansas! Earlier on I had tweeted about me visiting KC, and the local .NET developer user group contacted me and asked if I wanted to speak at a user group meeting on that evening. Of course the answer was a resounding yes! And the best part is that the Xamarin KC user group also joined the fun for their first ever joint event. We had a great attendance with a full room of about 65 people, and a very nice interaction. After the event, a small group gathered at a local bar and we had pie and drinks (I had a root beer float, because why not). Excellent way to make new friends in a new city! I also held my talk “Building Truly Universal Applications with Windows, Xamarin and MVVM Light”.  You can find the slides and code here.

DevIntersection Europe, Haarlem, The Netherlands

Right after my return from the US (with the visit to Kansas City, a few days in the office in Seattle and then the MVP and Regional Directors Summit in Bellevue/Redmond), I had another short trip to the Netherlands. I spoke at the DevIntersection conference in Haarlem, a small city not far from Amsterdam. The location was superb, a convention center close to the historical center of the city, the hotel was great too (though the bed was wayyyyy too soft for me :) and the audience was very nice. It is definitely smaller than DevIntersection in the US (where they have events in Vegas and Orlando), but I had a good albeit small audience nonetheless and some great interactions with attendees and fellow speakers.

I spoke about the Windows 10 Universal Windows Platform, a dense session which contains information about creating a new UWP app; adapting the user interface to the various form factors, resolutions, orientations etc; porting classic windows applications to the Windows 10 ecosystem with the Desktop App Converter (also known as Centennial bridge); the Windows Continuum; and Microsoft HoloLens. Unfortunately because of unknown technical issues, I was not able to stream the HoloLens output to my phone nor to my Surface like I used to do. Unfortunately we ran out of time before I was able to solve the issue (which would probably have required restarting the HoloLens and the phone). I want to apologize to the audience for this technical glitch. I hope that the people who joined me later for a quick trial of the HoloLens were happy anyway, and that the others didn’t go back home with a bad image of this amazing technology :) I recorded a few videos showing the various demos I wanted to give, you can find all the material including code and slides on this page.

Thanks all for attending and happy coding!

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

#Microsoft #Experiences in Paris: Code and slides

.NET, Conferences, HoloLens, MVVM, Technical stuff, Windows 10, Work, WPF, Xamarin, XAML
No Comments

Last week I had the pleasure of taking the TGV from Zurich to Paris, and after a quick 4 hours of comfortable travel, to make my way to the Porte Maillot and the Palais des Congrès.

TL;DR: All slides and source code is available from here.

A podcast

After a good night sleep I made my way to the speakers lounge and prepared the last steps for my talk. Then I took a moment to head to the meeting room where the Live Tiles podcast was being recorded. A band of podcasters got together and talked about the future of Microsoft. It was so nice to “see these familiar voices” in action. Even nicer when Christophe (Toss .NET) and Denis saw me and pulled me in to talk about HoloLens and our experiences with this device. You can hear the recording here, my contribution starts at 36:30.

My talk: Really universal apps with Xamarin and MVVM Light

My talk was titled (in French) “Construisons des applications vraiment universelles avec Windows, Xamarin and MVVM Light”. This favorite topic of mine shows how you can structure an application to share a maximum of code without any compromises. You can build healthy layers of Model and ViewModel, unit test them so you can feel secure about not breaking anything with future changes. Then you can build a thin layer of real native user interface for any supported framework with XAML or Xamarin (Windows Presentation Foundation, Windows 10 Universal, Xamarin.iOS, Xamarin.Android). And if you are in an enterprise scenario and looking for maximum productivity, you can also of course use Xamarin.Forms and render the same UI to all supported platforms.

The MVVM Light Toolkit assists you in these tasks, notably by providing a Data Binding framework for Xamarin.iOS and Xamarin.Android, as well as components that make it very easy to connect a list control to an ObservableCollection, with automatic refresh in case the collection changes. This open source toolkit is in it’s version 5.3, has been downloaded almost 1.7 million times and is even used by Microsoft to build parts of Windows 10.

I was really pleased when I headed to my conference room and saw a long queue in front of the entrance. I gave my talk to a standing room of about 270 people, and loved the interaction during and after the talk. A lot of very positive feedback, and we stayed and talked until the hostess kicked us out of the room :)

Thank you to everyone who came and made this a memorable moment. You will find all the details of the talk, the slides and the source code from this portal.

Some tea

Before I made my way to the Palais des Congrès, I took a pit stop at one of the most wonderful shops on Earth: the Mariage Frères tea store. This old fashioned store is stock full of amazing teas from all over the world. It’s a must-visit if you are a tea enthusiast or if you just want to spend a moment living in an atmosphere of luxury and pleasure.

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

Slides and code samples for VS Live Redmond

HoloLens, MVVM, Technical stuff, Universal Windows Platform UWP, VSLive, Windows 10, Work, WPF, Xamarin, XAML
No Comments

VS Live just took place in Redmond, and I had a great time. I had three sessions in one day, and I was really exhausted in the evening, but it was absolutely worth it. Speaking in Building 33 (the conference center on Microsoft campus) was an amazing experience. I have spent so many hours in this building, listening to amazing speakers of Microsoft and others, during MVP summits and other events… so really it was quite magical to be on the speaker side this time, in room St Helens.


Thanks to every one who came to my talks! I hope it was informative and useful, and that it encourages you to try those technologies and techniques.

Here are the pages for the talks I gave:

Windows Presentation Foundation (WPF) 4.6
Windows Presentation Foundation is what people are using to build real applications for the enterprise, the industry, the workplace, and for every situation where Windows 10 Universal isn’t quite ready yet. Far from being dead, WPF is 10 years old this year, and it’s still alive and kicking. It gives Universal Applications a run for their money. In this session, you’ll learn what is new in Windows Presentation Foundation, where it’s going in the future, and what you can achieve with WPF that Universal Application developers can only dream of. We’ll also see how these two roads cross and how existing WPF applications can be brought to Windows 10 using the Centennial bridge. Finally we’ll discover new features and tools recently implemented for WPF developers.

Windows 10 – The Universal Application: One App To Rule Them All?
Windows 10 and the Universal Windows Platform offer a lot of productivity and flexibility around targeting the broad set of devices that run Windows. As a developer, you have a lot of choice–from building a single binary that is identical on all devices, through to an app that adapts to the type of device and on to the point of building an entirely different app for each class of device. What’s the right thing to do? How should you think about building the “One App to Rule Them All?” What are the design and implementation trade-offs you need to consider? This session dives into these areas with a hands-on approach and shows what it really means to be building apps across families of Windows devices that have different capabilities. We will also talk about bridges (and especially the iOS Bridge to Windows 10), and new platforms such as Continuum and HoloLens (with live demos).

Building Truly Universal Applications with Windows 10, Xamarin and MVVM
With Windows 10 supporting an unprecedented number of platforms and form factors (from IOT to phones to tablets to laptops and desktops to XBOX and SurfaceHub, and even the new HoloGraphic computer HoloLens), the name ‘Windows 10 Universal application’ is fairly accurate. But to be honest, shouldn’t a truly Universal application run on Windows 7, iOS and Android devices too? Thankfully, this is possible thanks to a clever architecture pattern named Model-View-ViewModel, the .NET portable class libraries and the Xamarin frameworks. With these tools, we can structure an application so that most of the code is shared across all the platforms, and then build truly native UI that adapts without any compromises to the device it runs on. In this session, we will understand exactly how such universal applications are built. Laurent Bugnion, a XAML/C# expert, Microsoft and Xamarin MVP who started making universal applications before it was even a thing, will show you practical knowledge with a lot of demos. Come listen from the creator of the popular MVVM Light Toolkit how this powerful but simple library can be leveraged to help you target more users than you ever dreamed of!

Happy coding!

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

Unity: Adding children to a GameObject in code and retrieving them

HoloLens, Technical stuff, Unity, Work

Update: The following feedback was pointed to me:

  • You should be careful when using GameObject.Find(…). First, it is bad for performance (note that in my code, I was using it in the Start method and then caching it. This is OK according to documentation, from a performance standpoint). Then, it relies on strings to pass the name of the object you are looking for. That’s not easily maintainable. Instead, it is better to set a public field in your script, and then assign the GameObject that you need in the Unity editor. To keep things simple, I won’t be doing this here but check the blog post here for more information
  • When you remove objects from a scene, you should always start by the last object and then go upwards.

End of update

When you work in the Unity editor, it is quite natural to use hierarchies of objects. For instance, you will have a table object and on this table object you want to place some cups objects, but if you move the table, you want the cups to move too. That’s quite a natural thing to do because it corresponds to the way that things are organized in “real life”. In fact, it even makes sense to have a hierarchy where the parent is an empty GameObject (which will be invisible), this way you can create logical groups of items.

For example, you can go in the Editor’s Hierarchy panel, create an empty GameObject (Right click on the panel and select Create Empty), and name it “Container”. Then you set a transform on the container, for example position = 0, 0, 2 meaning that the Container will be positioned 2 meters in front of the origin point.



Then you can right click on the Container and select 3D Object / Cube to add a cube to this parent. If you so, the new Cube will appear at the exact same position at the Container, as you would expect.



In code however, this is a little more tricky. This is where we realize that there is no true hierarchy of object in Unity but there is a hierarchy of transforms. Let see how to do that:

Creating new objects below the Container

Since we have an empty GameObject named Container in the scene, we can retrieve it in a script with the following code:

_container = GameObject.Find("Container");

The _container field, as you would expect, is of type GameObject. If you inspect it in the debugger, you will see that it is placed, as expected, at (0, 0, 2) (this is the transform.localPosition).

Now let’s create a new Cube and add it to the GameObject. Unfortunately, we notice that there is no Add or AddChild or similar method on the GameObject class. This is where we need to work with Transforms. The following code helps:

var newCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
newCube.transform.SetParent(_container.transform, true);
newCube.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);

In this snippet, we create a new Cube of 20 cm size, and we specify that the Cube’s transform’s parent is the Container’s transform (incidentally, Unity says that you should use SetParent and not the parent property directly, even though it can be set. Welcome to the ugly world of scripting ;). This will effectively create a hierarchy like we have in the editor. But there is a catch! If you run the code now, you will notice that the new Cube doesn’t appear, like you would expect, at (0, 0, 2) but it appears at (0, 0, 0). If you run this in a HoloLens, you will get pretty confused because (0, 0, 0) is probably going to be your head, and so the Cube is placed around your head and you won’t even see it until you move to a different location).

If you inspect the newCube in the debugger, you will see that its localPosition is set to (0, 0, –2). So it seems that Unity went out of this way to misunderstand what I was trying to do, and forced the newCube location to be at (0, 0, 0) globally, which means (0, 0, –2) relative to the parent. Ugh…

When reviewing the documentation, I found an overload of SetParent which takes a parameter named worldPositionStays of type bool. I thought that was promising, but setting this parameter to true didn’t change a thing. I also tried variations of the calls above. The newCube still appeared at (0, 0, 0). So to fix it, I forced the localPosition to be at (0, 0, 0) (relative to the Container). This way the global position of the Cube is (0, 0, 2).

newCube.transform.localPosition = new Vector3(0f, 0f, 0f);

This sounds unnecessarily complicated, so if I am doing things the wrong way, please add your knowledge in the comments, thanks!

Retrieving the children

Now how can we retrieve the children and iterate on them? For instance, this can be useful if you want to clean the scene by removing all the Cubes, but leaving the Container in place so the user can add more Cubes. Here too, we need to work with the transform hierarchy. Here is the code:

Note: For this simple demo I am not going to update the code BUT as was pointed in the comments, you should rather remove objects from the end of the hierarchy!

foreach (Transform t in _container.transform)
    var cube = t.gameObject;

In this code, we get the transform property of the Container and then we iterate through all its children. Then we retrieve the gameObject property of each transform, which corresponds to the Cube that we want to delete, which is done by calling the Destroy method.

Hopefully this quick tutorial will help you when you do this kind of things. Structure is very nice, but structuring a scene in code is a bit tricky. This should save you some time. Now again, if you see something that can be improved, don’t hesitate to point it out in the comments.

Happy coding!

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)

Share on Facebook

Back from Sweden! Slides and code for my #DevSum16 session

.NET, Conferences, HoloLens, Technical stuff, Universal Windows Platform UWP, Windows 10, XAML
No Comments

I am back from Stockholm and the DevSum conference! It was a great trip, what a beautiful city and lovely people! It was great to be there with so many friends from our beautiful community, and especially my colleague and friend Rene Schulte.

On Thursday, I started by helping my good friend Tim Huckaby with his keynote. My role was very limited, just monitoring the live stream coming from Tim’s HoloLens. Tim is a great speaker and his keynote was very interesting and funny. So nice to see him! Later, Rene did a talk about HoloLens 3D development. Always a great pleasure to see Rene show how to use Unity and build 3D apps!


On Friday, it was my turn to speak. I have a Windows 10 Universal session and I decided to spice it up with a few demos of new platforms. It was a bit scary because there were quite a few moving pieces, and everything had to play together perfectly. And it almost did! The only thing I didn’t think about is that the Continuum dock is “protected” with HDCP. That means that you cannot connect the Dock to a projector. Such an annoying (and useless) feature! Thankfully, the conference center where DevSum took place had awesome technicians, and one of them saved my day by connecting an HDMI-to-VGA adapter which circumvented the issue.

The talk was quite beefy: We defined what a Universal app is, then we talked about Adaptive UI. We discussed the Centennial and Islandwood bridges before talking about Continuum and HoloLens. The final demo saw me switch my presentation to my Windows 10 mobile phone (950XL), show some slides in Powerpoint, then demo some Universal apps on this platform. Finally I started the HoloLens application on my phone, in Continuum mode. Since this is also a Universal app, it adapted to the big screen beautifully and I could stream what I was seeing through my HoloLens. I demonstrated how universal applications run on the holographic platform, including our own apps. It’s just as simple as deploying them to the HoloLens!


We definitely live exciting times, and it’s really great to be working on these new platforms. You can find the slides and sample code for this talk on my website. The session was recorded, and I will tweet when the recording is available for your viewing please, so stay tuned to my Twitter feed. Thanks to everyone who came to see this session. I really hope it was informative and useful to you!

Happy coding

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

My #HoloLens 101 notes

HoloLens, Technical stuff, Work

Yes finally I have a HoloLens device (thank you IdentityMine for footing the bill and facilitating the purchase). Even though IdentityMine has a long history of 3D development, and we have been working with HoloLens devices for the past few months in collaboration with Microsoft, so far my inputs have been limited to helping the team brainstorm concepts, test the apps, give feedback, and help with some presales activities. In the contrary of some of my colleagues, I am not a 3D developer yet, and I am eager to learn.

Here are a few notes I took during the learning stages. I am sure that many of you are in the same boat as I am, and these may come handy if you want to progress with HoloLens and Unity3D development.

A few preliminaries

As I mentioned, IdentityMine has been developing for HoloLens for a while now. You can see a session that my esteemed colleague Rene Schulte and I gave at the recent Build 2016 conference about an application that we built.

Even though you can code HoloLens applications with any 3D framework that supports Direct3D, the consensus these days (and the solution that Microsoft recommends) is to use Unity. This is a middleware (meaning that this is a set of APIs that will create code that then runs on a number of platforms, including HoloLens).

Rene Schulte has a very good blog post with recommendations. You should probably read it too!

Charging the device

You would think that charging the device is trivial! Well in fact… it charges with a micro-USB cable similar to what you use for your mobile phone (except if you have the latest generation which uses USB-C). Like for mobile phones, there are two kinds of cables: Charging only, and Charging+Data. Whichever you use, make sure that you test your cables and use the ones which charge the fastest. When testing cables to charge my mobile phones, I found huge discrepancies (some cables charge up too 3-4 times faster than others). A good choice is to use the cable and charger which come with the HoloLens device itself!

With a full charge you will be able to use the device for a few hours. I didn’t time it really, but when learning to code, I leave the device on and use it on and off for a whole evening without needing to charge. You can then charge it overnight, which is very convenient (it takes a while to get a full charge, so plan accordingly!).


Before you start using the device, you need to calibrate it. This is important so that your eyes can focus properly on the holograms. The Calibration app takes a couple of minutes to execute. The very first time you start the device, you will also get a tutorial about gestures. Later on, the Learn Gestures app can be started separately. Probably a good idea to run through this basic information! Note that you can modify and retrieve the Interpupillary distance (IPD) from the Device Portal (see below). This is an important value for a good experience!

Using apps

What better way to get started than to use apps! For a first try, the Holograms app (preinstalled) is cool: It allows you to place holograms anywhere in the room, and observe them from diverse angles. There are even some video holograms. It’s a good idea to use this app to learn to interact with the menus. Note that you will need an internet connection for this app to work!

In addition to the preinstalled apps, you have a choice of apps developed specifically for HoloLens in the store. I like the HoloTour, which gives you a guided tour of Rome and a high plateau in Peru. I hope we will see more content coming soon! Also available are games like Young Conker and Roboraid. Another app named Holo Anatomy will teach you about the human body. While HoloTour, Young Conker and Roboraid are what I would call full blown apps, Holo Anatomy is more of a proof of concept. Still cool to try!

Make sure to try the Fragments game too! It is probably the most compelling holographic experience at the moment, and integrates very nicely with the room you are in! One of the character was seen sitting on my office chair for example!!

There is also a great app developed on suggestions from the users’ community, called Galaxy Explorer. This app is available as source code on Github and you need to build it. See below in the “Learning to code” section.

You can also install 2D universal apps for Windows 10. Any UWP app should run fine though some (like Skype) have been customized for the HoloLens device. I installed OneDrive (which allows me to watch videos stored in the cloud), Groove Music (which lets me stream music from my OneDrive), Cast (a great universal podcast app which synchronizes content between all Windows 10 devices) and a few more.

Unfortunately I cannot find a way to download and save a file on the device, so for now the only media you can consume is online streamed media. This is OK but I hope we’ll be able to get some media on the drive for offline consumption at some point.

Here are a few screenshots. Note that some are a screen grab of the portal videostream so the quality is not great, but they are just illustrating the point. The actual quality is much better!

The game “Fragments” is one of the most impressive HoloLens experiences at the moment.

Groove Music and Skype pinned to my home office wall

On a HoloSkype call with my colleague Rene. We both can draw on the scene (him in green and me in blue).

Finding your device’s IP address

In many occasions you will need your device’s IP address. To do this, wear the device, and then say “Hey Cortana”. After Cortana shows up and you hear the sound meaning that she is listening, ask “What is my IP address”. It will show up. Alternatively, you can open the Settings app, and then navigate to Network & Internet, Wi-Fi, Advanced Options and write down the IPv4 address. Note that you can also find it using your Router’s configuration menu, if you have access to it. It might be a good idea to configure your router to always use the same IP address for the device.

Using the device portal or the app

The device portal is a must-try. To open it is quite easy: First you need to find your device’s IP address (see above). Then you can enter this IP address in a web browser (ignore warnings about invalid security certificate), and it will connect to your device which acts as a web server. Note that on some networks, this will be prevented to work so make sure that the network you use is open to this.

Alternatively, you can try the HoloLens app available here. The cool thing is that it is a universal app, and so you can also let it run on a Windows 10 mobile phone. UWP FTW!!

The web portal lets you do the following operations:

  • Checking the device status and other information such as device name and Windows version, online status, temperature, battery level etc
  • Check your interpupillary distance (IPD) and modify this value
  • Change sleep settings. I recommend setting a high enough value so the device doesn’t go to sleep while you are coding, which can cause deployment to fail!
  • See in real time (almost) what the user is seeing. This is called Mixed Reality Capture (MRC). It even lets you make videos and take pictures (which include the holograms!). Note however that there is a lag of a couple of seconds between what the user sees and what is shown on the screen. Also, the screen refresh rate will drop to 30 FPS while the MRC is active (instead of ideally 60FPS). If you have fast animations, this can be a little disconcerting.
  • See the list of processes running on the device and getting performance information.
  • Seeing a list of installed apps and providing some management tools. You can even side load an app from this page.
  • Getting crash information.
  • Forcing the device to run in kiosk mode (i.e. disabling the start menu, disabling Cortana and hiding pinned applications). Great for demos!
  • Logging
  • Simulating rooms: You can take a capture of a given room and save it. Then you can pass this recording to another developer, who can use this page to load it to his device. Great when you need to test an app in some specific room conditions.
  • Networking settings and information such as device IP, MAC address etc
  • Virtual input, allowing the developer to simulate keyboard input. Note however that you can simply use a bluetooth keyboard if you want to easily enter text.

The universal app seems to show the live stream with less lag. Definitely worth a try!

Taking screenshots and videos

You can take screenshots and videos of what you see in two different ways. Note however that the resolution of the screenshots and the videos is not going to be as good as the real thing, because they downplay the device resolution when screen capture is on.

Using the device portal

If you are an operator for someone else trying the headset, launch the device portal (see above) and navigate to the Mixed Reality Capture section. You will see buttons allowing you to record, take photo or even see the live stream (with a few seconds delay).

Using Cortana

More spontaneously, if you are in a great experience on HoloLens and want to share with the world, you can take a screenshot by saying “Hey Cortana” and then “Take a picture”. Similarly, for videos, say “Hey Cortana” and then “Take a video”. When you are done filming, say “Hey Cortana” and then “Stop video”. This takes a bit of exercise to get right, so make sure to train before you do it for real. The pictures and videos will then show up in the Photos application on the device, as well as in the Device Portal, where they can be downloaded from.

Letting people try the HoloLens

For a better experience, you should always get a new user’s Interpupillary distance IPD! Use the Calibration app to do that. Alternatively, there are some devices one can purchase, but they require some know how so make sure to learn how to use them. Once a user’s IPD has been determined, you can always modify it or retrieve it from the Device Portal (see above).

One thing I noticed after letting a few “newbies” try it out: The “tap” gesture is not as easy as it sounds. A good friend never got it right. So in addition to the calibration, it is interesting to get some time to do the Learn Gestures applications too. At first it is a bit hard to guide them to start the Calibration application. What I did to help is this:

  • Connect the UWP app to the device and observe what they are seeing. Sure it drops the frame rate but it is really helpful to know what they are currently seeing, in the beginning.
  • You can do some gestures for them. Simply put your own hand in front of the visor and bloom or air tap. For example to teach my friend how to air tap, at first I told her to simply look at a tile and then I air tapped myself. This helped her to understand the gaze gesture better.
  • There is a clicker that comes with the HoloLens device, that you can use instead of an “air tap” gesture.

It is pretty overwhelming at first, and for us it is easy to forget that it is pretty overwhelming at first I was happy to have the occasion to observe a few people trying it out for the first time and learn from this experience.

About Unity

It’s easy to confuse Unity (the 3D middleware) with Unity (the Inversion-of-control framework). The fact that both of these are used by Microsoft makes it even more confusing. In case of doubts, make sure to use Unity3D instead of just Unity. In this post, I will simply talk about Unity and this is NOT the IOC one ;)

When you install a new version of Unity3D, it might install side by side with older version. DO NOT GET CONFUSED! If you open a HoloLens Unity project with a version of Unity that is not suitable, you will get VERY confusing error messages. Make absolutely certain that you have the correct version of Unity open. Currently, the version is

Learning to code

The HoloLens academy is a Microsoft offering and has a growing number of tutorials. You can find all the information on their webpage.

Note that you don’t strictly need a device to get started. There is a free emulator which works with Visual Studio and lets you try your code out (see below). It’s a good way to wait for a device, as getting one can take a while due to overwhelming demand.

Learning to deploy

Before you even get to coding, it would be a good idea to learn to build and deploy a project. For instance you can follow these steps to download and build an existing project, the open source Galaxy Explorer:

  • Go to the Galaxy Explorer GitHub repo
  • Fork or download the code as Zip file, and extract it.
  • Start Unity3D
  • In the start dialog, press Open
  • Navigate to the folder GalaxyExplorer and press Select
  • Wait until Unity loads the project
  • Open the menu File / Build Settings
  • Make sure that the Windows Store platform is selected
  • Set SDK to Universal 10
  • Set UWP Build Type to D3D
  • Make sure that Build and Run is set to Local Machine.
  • Press the Build button
  • In the Build Windows Store folder selection menu, create a New Folder and name it App.
  • Make sure that the App folder is selected.
  • Press Select Folder.

This will start the build process. Note that this only creates the Visual Studio project with all necessary files. You will still need to open the created Solution file. Follow the steps:

  • Navigate to the App folder that you created earlier.
  • Open the GalaxyExplorer.sln file in Visual Studio 2015.
  • Make sure to select the following configuration: Release / x86 / Remote Machine.
  • If the Remote Connections dialog shows up, enter your device’s IP address in the Address field and make sure that “Universal (Unencrypted Protocol)” is the Authentication Mode selected. Then press Select to establish a connection to your device.
  • If this is the first time you deploy, you will need to enter a pin. The pin should be shown on your device, but if it is not, go to Settings, Update, For Developers, Pair. Then enter the pin into the Visual Studio dialog.
  • Finally, select Debug / Start without Debugging.

If everything is configured correctly, the application should start, and you can feel confident that deploying works for your future studies.

Don’t let errors like “System.Object doesn’t exist” startle you

If you run the examples of the HoloLens academy, you might encounter some weird errors when you generate the Visual Studio code from Unity, and then open the resulting SLN file in Visual Studio. You will see a LOT of errors because the Nuget packages have not been restored yet. Do not fret, you can just build, which will force the Nuget packages to get restored, and all the ugly errors should go away.

Match the file name and the class name

In C#, it is highly recommended that the file name and the class name match, and that you have only one class by file. But these are recommendations only. When coding in Unity however, I had some compilation errors because the file name didn’t match the class name. If you follow the early tutorials (for example the 101), they will ask you to create a new C# script file with a certain name (for example GazeGestureManager). Make sure to enter that name as you create the script. If you don’t do this, but instead you create a new script file with the default name, and then rename the script file to GazeGestureManager, Unity will refuse to do anything with this file. This is because the class name inside the file and the file name don’t match. So be careful to follow the steps exactly.

Sometimes Unity starts MonoDevelop instead of Visual Studio

In the course of the tutorials, you will sometimes have to edit some C# script files. Unity comes preinstalled with the MonoDevelop code editor, but using Visual Studio is more comfortable. To ensure that Visual Studio is launched, check the following settings: Edit / Preferences / External Tools / External Script Editor and make sure it is set to Visual Studio 2015.

Even with this setting properly configured, it can happen that Unity gets confused and starts MonoDevelop anyway. In my experience the file opens in Visual Studio anyway and you can just close MonoDevelop and move on.S

Starting the emulator

The emulator is a good way to get started when you don’t have a device with you. Strictly speaking, it’s not really faster to deploy to the emulator than to a real device, and of course the experience is not comparable, so you will probably prefer an actual device if you have a chance. You can also simulate gazing at objects, tapping them, walking around etc (see below).

The emulator can be started from Visual Studio directly (it is called HoloLens Emulator in the list of all the emulators and devices). If you don’t see it, you might have to install it first :)

I had some cases where the emulator refused to start, because my machine didn’t have enough memory (for example on a Surface Pro 3 with 8GB RAM, the emulator requires 2GB RAM and Windows decided there wasn’t enough left… annoying!). In that case, you should do the following:

  • Create a BAT file.
  • Enter the following command:
    “C:\Program Files (x86)\Microsoft XDE\10.0.11082.0\XDE.exe” /sku HDE /video 1268×720 /vhd “C:\Program Files (x86)\Windows Kits\10\Emulation\HoloLens\10.0.11082.1039\flash.vhd”
  • Save the BAT file and restart your machine
  • Before you do anything else, run the BAT file to start the emulator.
  • Then only start Visual Studio and deploy to the emulator, which is already running.

Issues when deploying to the device

In theory you can deploy to the device using a USB cable attached to your laptop, or using an internet connection and “Remote Machine” (not Remote Device like stated in some locations in the official documentation).

To deploy using your internet connection, you must make sure that the device is connected to the same network as your PC. I had a few issues when trying to deploy at the hotel, and I suspect that there was a firewall or something which was preventing me from successfully deploying. I am still investigating this. At home it seems to work fine.

Make sure the device is awake…

This may sound silly but it happened to me a few times… I remove the device, place it on the table upside down (which seems the safest way), and then after I make changes to the code I hit Ctrl-F5… and it fails. What happens is that after a few minutes, the device goes to sleep. Even if you wake it up quickly after you start deploying, it doesn’t seem to work (I think there is a delay for the device to reconnect to the network). So really, make sure that it is up and running before you hit Ctrl-F5!


I seem to have issues deploying to the device when the source code is on a FAT filesystem (SD card). If I copy the same source code to my main SDD (which is NTFS), then it works. I will investigate more. It’s not completely surprising because I had the same issue before with Windows 10 UWP applications, and the HoloLens is a Windows 10 device after all. It would be nice to be able to do this from an SD card though, because a typical HoloLens project is pretty large. I’ll update this if I find a solution.

Deploying over USB

Here too I am having issues when I am trying to deploy over USB. I am using the original HoloLens USB cable, and I am getting a cryptic error (Unexpected Error: -2145648626). Here too I will try to find more information and update this. So far I didn’t manage to solve it, but here are a few indications from other people in the community that might help you:

  • If your HoloLens device goes to sleep, and then you wake it up and try to deploy to it, it might fail. In this case, restart Visual Studio and try again.
  • Sometimes the USB connection keeps connecting and disconnecting continuously. In this case, shut the device off, then plug the USB cable in. This will wake the device up. Then you can try deploying again.

Overall, it seems that deploying over Wifi is more reliable than over USB. That’s a shame because USB works faster. My guess is that it’s a firmware issue and I hope it will get fixed some time in the future.


Well that’s a pretty long post… so I will stop here and publish. I am not stopping my investigations and learnings however, so you can probably expect more such notes in the future. I hope you enjoyed reading and that it is useful!

Happy holocoding!

GalaSoft Laurent Bugnion
Laurent Bugnion (GalaSoft)
Share on Facebook

Source code and samples for the ADC15 talks

ADC, HoloLens, MVVM, Technical stuff, Windows 10, Work, Xamarin

I just published the material for last Monday’s Advanced Developer Conference in Frankenthal Germany.

Read the rest of this entry »