13

On my archlinux system I did a fresh installation of:

  • mono 3.0.7
  • monodevelop 4.0.8
  • monodevelop-debugger-gdb 4.0

When I debug an application the debugger doesn't stop on the breakpoints, even not on the System.Diagnostics.Debugger.Break (); code.
And an error windows is displayed with the following message :

Could not connect to the debugger

Does anyone know how to fix it?

Nicolas
  • 6,289
  • 4
  • 36
  • 51
  • 1
    This is also happening on openSUSE. I wish I knew how to fix it too. – David Mulder Jun 09 '13 at 01:36
  • 1
    I get this on Arch too. See [this bug](https://bugzilla.xamarin.com/show_bug.cgi?id=12684) on Xamarin. – pav Jun 14 '13 at 05:52
  • 3
    Have you tried to untick the "Run on external console" checkbox in the project run settings? – dna Jun 14 '13 at 14:25
  • @pav: Glad to hear that, my Arch box did me the same trick since this huge monodevelop update! – dna Jun 14 '13 at 19:28
  • @dna Awesome man, you gave us the solution!!! I don't know the utility of the "Run on external console" feature and why it's checked by default. Anyway, don't hesitate to fill a real answer to get your reward. – Nicolas Jun 14 '13 at 23:04
  • I think it's checked by default because MonoDevelop is geared toward mobile development. Seems like it's supposed to connect to your smart phone for debugging. – David Mulder Jun 15 '13 at 02:52
  • This worked for me. @dna you aught to post this as an answer. – David Mulder Jun 15 '13 at 03:12
  • Thank you, I didn't post it as an answer in the first place since it is at best a workaround! That being said I am glad you are now able to debug your projects :) – dna Jun 15 '13 at 11:32
  • @Nicolas: "Run on external console" pops up a terminal and executes your application there instead of in the Monodevelop output window. – dna Jun 15 '13 at 11:33
  • @dna Thanks for your explanation. I'm really surprise that it's the default behaviour. It lacks at least a comprehensive error message. – Nicolas Jun 15 '13 at 15:25
  • 1
    @Nicolas: For the story - take that with gloves - and if I *recall* correctly, before the update who changed the IDE appearance (Looks like Xamarin) it wasn't the default behavior and both options were working fine. But After this *huge* update, the Monodevelop builtin output windows was broken therefore back in these days, that checkbox needed to be ticked - at least on my box. Finally came the update who leads us there, and forced us to untick this very same box! Hopefully at some point we will have both alternatives working :) – dna Jun 15 '13 at 16:51

4 Answers4

6

This is due to a recent gnome-terminal change. Recent gnome-terminal no longer accepts the --disable-factory argument.

Install the xterm package, then in a gnome-terminal session do the following:

$ unset GNOME_DESKTOP_SESSION_ID 
$ monodevelop

This will cause monodevelop to use xterm as its external terminal and all should be well.

Kayvan Sylvan
  • 466
  • 4
  • 4
4

As a workaround untick the "Run on external console" checkbox in your running project settings. You can find this option in the "Run" tab from the settings pane.

dna
  • 1,085
  • 7
  • 15
3

Another factor which will cause break points to not be hit is if you don't have "Emit debugging information" button set.

You'll find this setting in "Project" tab then at the bottom of the menu " Option". Then look for "Build" tree branch then "Compiler" option. The checkbox for "Emit debugging information" is here.

jdosser
  • 143
  • 1
  • 7
1

I had a similar problem - breakpoints was not triggered while checkbox "Use MSBuild build engine" was checked in the project properties.

Vladimir Shiyanov
  • 1,236
  • 16
  • 18