I built my game for UWP with Il2Cpp. When it tries to connect to the internet I get this error:
Exception thrown at 0x2121FE8A in game.exe: 0xC0000008: An invalid handle was specified.
Since the C# source turned into a C++ project I've no idea what's wrong in my code. it works errorless when I play in Unity.
How can I find a clue on what's going wrong?
Screenshot:
I would not directly debug in the c++
generated code ... it is very intransparent and hard to interpret (also the Manual doesn't really help here)
Rather build and deploy the app with the option Wait for Managed Debugger
enabled and connect a Debugger in the c# VisualStudio solution (source)
Set up your Unity project build settings and enable Development Build
, Script Debugging
and Wait for managed debugger
Build in Unity, open the solution in VisualStudio instance and deploy it to a remote device
The build and deploy takes considerably longer and once deployed you're asked to attach the debugger
Open any script in VisualStudio from within Unity (so you have the entire solution loaded correctly) and select Attach Unity Debugger
from the drop down
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)
On this way you can debug your normal c#
code, set breakpoints etc. while it is actually running the Il2CPP
generated c++
code.