Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 453 [details]
simple example with a button and a label to use a s a test case
Description of Problem:
When deploying the app on a device, the debugger connects successfully on the first attempt (nice work!). After closing the debugging session and the app, when selecting debug a second time from MonoDevelop, it prompts to launch the app on the device, but when opening the backgrounded app, the debugger never connects. However, explicitly closing the app on the device allows the debugger connection to be re-established.
Steps to reproduce the problem:
1. Open an app and set the configuration to Debug|iPhone
2. Connect the device
3. Select Debug in MonoDevelop
4. Open the app on the device when prompted and a debug session is established
5. Stop debugging
6. Close the app by pressing the home button on the device
7. Select debug again in MonoDevelop
8. Launch the app on the device
The first deployment/debug works fine but the subsequent ones don't connect the debugger unless the app is explicitly shut down on the device.
The debugger connect.
How often does this happen?
I attached a simple test case to try this with.
Also, if I cancel the debugger in MonoDevelop it reports the following error:
System.IO.IOException: DWP Handshake failed.
at Mono.Debugger.Soft.Connection.Connect () [0x000f9] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1003
at Mono.Debugger.Soft.VirtualMachine.connect () [0x00000] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:263
at Mono.Debugger.Soft.VirtualMachineManager.ConnectInternal (System.Net.Sockets.Socket dbg_sock, System.Net.Sockets.Socket con_sock, System.Net.IPEndPoint dbg_ep, System.Net.IPEndPoint con_ep) [0x0008f] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs:305
This will likely not be implemented, adding support for attaching to a process
that has already been attached, but lost the connection to MonoDevelop will
require quite massive changes for a relatively small use-case.
Note that there is another bug which makes this issue more prominent: the app
should exit when you stop debugging in step 6 (this is bug #322). If the app
actually exits when you stop debugging you should run into this issue a lot
less (only if you background the app, stop debugging in MD, restart debugging
and then re-activate the app).