Blog Post

Modern Work App Consult Blog
1 MIN READ

How to debug Unity projects with IL2CPP backends on the Hololens

mplogas's avatar
mplogas
Icon for Microsoft rankMicrosoft
Jan 15, 2019
First published on MSDN on Nov 08, 2018
Debugging Unity projects with a .NET backend is rather easy. Unfortunately, it's deprecated at will go away and some point in the future.

Then there is IL2CPP. It's considerably faster and even build times seems to be quicker to me. However, debugging was not possible or only became available for the player.



That is, until 2018.2.x.



But let's start from scratch.

  1. Set up your Unity project build settings and enable Development Build , Script Debugging and Wait for managed debugger

  2. Build in Unity, open the solution in a VS.NET instance and deploy it to a remote device

  3. The build and deploy takes considerably longer and once deployed you're asked to attach the debugger

  4. Open a new VS.NET instance from Unity and select Attach Unity Debugger from the drop down

  5. You should be prompted with a window that allows you to select the lens. (It should also work when the lens is attached via USB, but you might need to enable inbound UDP communication for devenv.exe )


Happy debugging!
Updated Jan 15, 2019
Version 2.0
  • BenBen's avatar
    BenBen
    Copper Contributor
    Hi, thanks for this tutorial. Unfortunately, in step 5 I just won't see my Hololens available. Are there any specific Windows settings I need to set so that this kind of communication is possible? I'm able to use Remote Playing with Unity, or simply deploy apps, so my network theoretically is not restricted... Any help is appreciated!
  • I too could not get my HoloLens 2 to display as an option in step 5. I tried manually inputting the IP address as well as 127.0.0.1 via USB in case that worked but nothing did, even after insuring both inbound and outbound devenv UDP traffic was allowed through my firewall. Is there another step mplogas ?