Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

HoloLens UWP w/ IL2CPP Backend -- No Debug Targets in Visual Studio 2017

Discussion in 'Windows Mixed Reality' started by BluiWulf, Aug 31, 2018.

  1. BluiWulf

    BluiWulf

    Joined:
    Feb 26, 2018
    Posts:
    1
    I am experiencing a very weird issue. I am creating an extremely basic application that will just display a model on the HoloLens. I managed to create and build the Visual Studio project using the .NET scripting backend, but see a warning that this will be removed in future releases of Unity Engine.

    When I try to build a new Visual Studio project using the IL2CPP scripting backend, the project builds and I can compile the project within Visual Studio, but when I go to select a debug target to deploy the application to, there are no targets.

    I just want to make the point that when I say no targets, I mean that I cannot even select "Local Machine". I have looked through all of my settings and verified the minimum target version of Win10 SDK and everything looks good. When using the .NET scripting backend, I see my full list of debug targets including the HoloLens Emulator. This only happens in the IL2CPP project and I cannot figure out why.

    Any help will be greatly appreciated.
     
  2. kwcae

    kwcae

    Joined:
    May 26, 2017
    Posts:
    30
    I ran into the same problem about 2 weeks ago, haven't been able to resolve it yet. Due to delivery schedules I've had to create a workaround to gracefully fail, capture data and display it on a world space dialog for manual inspection.

    If you have any luck with this, please let me know, it'll be about 2 more weeks before i can tackle this issue on my side again.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    Can you post a screenshot of what you're seeing?
     
  4. kwcae

    kwcae

    Joined:
    May 26, 2017
    Posts:
    30
    I've attached an image showing the Select Unity Instance window that appears after pressing Attach to Unity button for in editor debugging. It's essentially the same behavior that occurs when Unity Tools for Visual Studios isn't installed, (it's installed). Quite odd to say the least.

    On re-reading the OP's post is appears as though they don't see the options for deployment of the built solution. EG: Build in Unity > Open Solution, Build in VS > Select target > Start Debugging
     

    Attached Files:

  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    So let me get this straight: in your case, you are unable to attach a debugger to a built game?

    Are you using IL2CPP scripting backend? Did you enable networking capabilities in the manifest? You need privateNetworks and internetClientServer. Did you enable debugging support in the build window? Is your device connected to the same network as your development machine?
     
    soleron likes this.
  6. kwcae

    kwcae

    Joined:
    May 26, 2017
    Posts:
    30
    Not a built application, I'm unable to attach the debugger when pressing play in the editor. (UWP build with the baclend set to il2cpp)
     
  7. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    85
    In my case, VS asked me if I want these installed, and it did it automatically. Try to do that manually by using the "Modify Installation" option of Visual Studio. You just need to add a certain module in VS. No biggie but enough to bust your eeehm.. that.

    I think this is the one you are missing marked with Yellow. Make sure to install it.
     

    Attached Files:

  8. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    Having the same issue with a UWP application running on PC - No debug targets visible in selection box
    I know when profiling a UWP application the profiler and the application can't be on the same machine. Is the same true for Debugging? I am currently running the CPP backed UWP application and the C# unity project on the same PC
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    We worked with the Visual Studio team to work around the same machine limitation, so this scenario should now work. But you need VS2017 Update 15.8 for it. Are internet client, internet client/server and private networks capabilities are enabled in the manifest?
     
  10. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    Hi, Yeah I am running Visual Studio 2017 15.8.3 and I have all the above selected in the manifest Manifest.PNG
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    Hmm. Did you check "Script Debugging" checkbox in the build window? Which Unity version are you on?

    upload_2018-10-2_15-38-23.png
     
  12. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    Yeah I have that selected too. I am using Unity 2018.2.9f1
    I notice that I have the Unity C# proejcts selected - with no way to deselect. I guess this would be hanging around from when I was using the .net scripting backend. Could this cause a conflict with the Debug targets?
    BuildSettings.PNG
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    No, it shouldn't. Any chance you have a weird firewall/antivirus setup? Is running game visible in the profiler if you tried attaching to it? You're not using Master build, are you (debugger won't work in master builds)? Are you using Visual Studio to deploy your app? I wonder what would cause the connection to not go through...
     
  14. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    I am running on a work laptop which could well have a stricter firewall setup. I will test this weekend on my home pc.
    I am not running a Master build, I was using release and I was using Visual Studio to deploy the app.
     
  15. sfaulkenberry

    sfaulkenberry

    Joined:
    Oct 2, 2018
    Posts:
    3
    Same issues as matt33315. Visual Studio 2017 Enterprise v15.8.6. Unity Editor 2018.2.10f1. Builds but no device dropdown with any build targets. Also behind a corporate firewall but can't really take home to test. Would love a solution.
     
    Last edited: Oct 5, 2018
  16. yjlim0202

    yjlim0202

    Joined:
    Sep 30, 2018
    Posts:
    1
    I am also having same issue. In my case I am using Hololens and set ‘release’ ‘x86’ but only play button is available. Anyone know how to solve this problem?
     
  17. gwendalbroudinpro

    gwendalbroudinpro

    Joined:
    Sep 13, 2018
    Posts:
    6
    Look at your errors on your generated solution, for me it was caused by substance material importer.
     
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    Can you check if TCP connections are getting through from your PC to your hololens?
     
  19. sfaulkenberry

    sfaulkenberry

    Joined:
    Oct 2, 2018
    Posts:
    3
    I can view the device portal for the Hololens and I can debug/deploy using the .NET scripting backend, so I'm assuming yes.
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
  21. sfaulkenberry

    sfaulkenberry

    Joined:
    Oct 2, 2018
    Posts:
    3
    Just had a chance to try again today. The options for targets have shown up. In the process of building and deploying now (takes an awfully long time compared to the .NET scripting backend). I will try to remember to update on progress.

    It may be a result of a hidden fix in Visual Studio as I updated to 2017 Enterprise 15.8.7 in the last couple of weeks and nothing else has really changed.
     
  22. SozoDev

    SozoDev

    Joined:
    Nov 15, 2016
    Posts:
    5
    I have the same issue. Building a HoloLens app with IL2CPP backend has the effect that there are no debug targets showing up in VS (not even local machine - only 'start'). I'm running the latest VS Community 2017 - 15.8.8. Unity 2018.2.11f1
    Building the same app with .Net backend, opened in VS, I can now see a list of deploy targets, including my HoloLens emulator.

    Any idea how to fix this?
     
  23. SozoDev

    SozoDev

    Joined:
    Nov 15, 2016
    Posts:
    5
    Ok, interesting. I rebuilt the project after updating to the latest VS but that didn't work, until I deleted my previous build and rebuilt it again. After opening that sln the deploy targets started working.
    So to be clear:
    1. Update VS to the latest version.
    2. Delete previous unity build from folder.
    3. Rebuild - See if it works.
     
  24. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    Could it be that the startup project was set to "Il2CppOutputProject" instead of the actual game project? That could cause it.
     
    LampreyPie likes this.
  25. tattichan

    tattichan

    Joined:
    Dec 14, 2016
    Posts:
    1
    Try following
    1. Enable Development, Script Debugging and Wait For Managed Debugger.

    2. Enable InternetClientServer (if you use WMRImmersive, enable PrivateNetworkClientServer)

    3. Open Windows Firewall with Advanced Security->inbound rolls. Select MicrosoftVisualStudio2017(profile:public、protocol:UDP) and allow connection.

    4. Build your application

    5. Notification message “You can attach a managed debugger now if you want” appear when you app launch.

    6. Back to Unity and open vs. Then attach unity debugger. If you succeeded you can see HoloLens in the list.
     
    matt33315 likes this.
  26. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    After following the above steps I can now see the instance of my exported UWP application in the target list.
    After selecting it I am then presented with the following console windows
    ConsoleAfterConnectingToProcess.PNG

    My game then shows the splash screen then nothing much happens after that. (The game doesn't load / run)

    Do I need to do something with this console window? or should I just leave it alone while I debug?

    Thanks
    Matt
     
  27. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    The console window disables network loopback restrictions while it's running, which allows debugger to connect. Do not touch it or debugging UWP application on local machine will stop working.

    So after you attach a debugger, it just gets stuck? Did you try pausing it in generated VS project to see where? Which Unity version are you on?
     
  28. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    83
    I tried again, this time leaving that console window alone - The game did run in the end it just took it almost 5 mins to get from the end of the splash screen to the start of the game (For those 5 mins all I got was the background colour of the splash screen). Of course when the game is running normally it doesn't take this long to start the game so Im not concerned. I was running both my deployed UWP game in release and my unity visual studio project in release configuration. Once the game did actually load the performance didn't seem too bad at all. I know other people have mentioned the performance while debugging is almost unusable. Looking forward to getting to the bottom of a very issues now.

    Thanks
    Matt
     
  29. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,086
    Yeah performance is pretty abysmal while debugging. We will be improving it in 2018.3.
     
    matt33315 likes this.
  30. LocalJoost

    LocalJoost

    Joined:
    Dec 28, 2016
    Posts:
    2
    Nothing of above works. What are you using as STARTUP project in the Unity solution?
     
  31. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    136
    I wanted to conclude this thread with the list of necessary steps:

    - The Hololens needs the capability "Internet (Client & Server)" (set in Unity or in VS afterwards does not matter)
    - you need to build with "Development Build" and "Script Debugging" enabled
    - You need "C++ Universal Windows Platform Tools" and "Unity Tools for Visual Studios" installed
    - make absolutely sure you clean the build directory after you toggled between NET and IL2CPP, OR after you toggled "Unity C# Projects"