Home
%3CLINGO-SUB%20id%3D%22lingo-sub-317998%22%20slang%3D%22en-US%22%3EHow%20to%20debug%20Unity%20projects%20with%20IL2CPP%20backends%20on%20the%20Hololens%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-317998%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Nov%2008%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Debugging%20Unity%20projects%20with%20a%20.NET%20backend%20is%20rather%20easy.%20Unfortunately%2C%20it's%20deprecated%20at%20will%20go%20away%20and%20some%20point%20in%20the%20future.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Then%20there%20is%20IL2CPP.%20It's%20considerably%20faster%20and%20even%20build%20times%20seems%20to%20be%20quicker%20to%20me.%20However%2C%20debugging%20was%20not%20possible%20or%20only%20became%20available%20for%20the%20player.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67845i9F5A41503A2E0238%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20That%20is%2C%20until%202018.2.x.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67846iD9B92A5A3A833822%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20But%20let's%20start%20from%20scratch.%20%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ESet%20up%20your%20Unity%20project%20build%20settings%20and%20enable%3CCODE%3E%0A%20%20%20%20%20Development%20Build%0A%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20%2C%0A%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20Script%20Debugging%0A%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20and%0A%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20Wait%20for%20managed%20debugger%0A%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67848i995E1B5CC2329373%22%20%2F%3E%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20Build%20in%20Unity%2C%20open%20the%20solution%20in%20a%20VS.NET%20instance%20and%20deploy%20it%20to%20a%20remote%20device%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20The%20build%20and%20deploy%20takes%20considerably%20longer%20and%20once%20deployed%20you're%20asked%20to%20attach%20the%20debugger%0A%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67850iABEFFE54D8C9012D%22%20%2F%3E%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20Open%20a%20new%20VS.NET%20instance%20from%20Unity%20and%20select%0A%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20Attach%20Unity%20Debugger%0A%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20from%20the%20drop%20down%0A%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67852i235AA39F2569B414%22%20%2F%3E%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20You%20should%20be%20prompted%20with%20a%20window%20that%20allows%20you%20to%20select%20the%20lens.%20(It%20should%20also%20work%20when%20the%20lens%20is%20attached%20via%20USB%2C%20but%20you%20might%20need%20to%20enable%20inbound%20UDP%20communication%20for%0A%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20devenv.exe%0A%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20)%0A%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67853i49BF9E7571D7DBB9%22%20%2F%3E%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%3C%2FOL%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Happy%20debugging!%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-317998%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Nov%2008%2C%202018%20Debugging%20Unity%20projects%20with%20a%20.%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-417700%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20debug%20Unity%20projects%20with%20IL2CPP%20backends%20on%20the%20Hololens%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-417700%22%20slang%3D%22en-US%22%3EHi%2C%20thanks%20for%20this%20tutorial.%20Unfortunately%2C%20in%20step%205%20I%20just%20won't%20see%20my%20Hololens%20available.%20Are%20there%20any%20specific%20Windows%20settings%20I%20need%20to%20set%20so%20that%20this%20kind%20of%20communication%20is%20possible%3F%20I'm%20able%20to%20use%20Remote%20Playing%20with%20Unity%2C%20or%20simply%20deploy%20apps%2C%20so%20my%20network%20theoretically%20is%20not%20restricted...%20Any%20help%20is%20appreciated!%3C%2FLINGO-BODY%3E
Microsoft
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!
1 Comment
Occasional Visitor
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!