I saw that 3.2 has support for attaching to a running Unity editor with MonoDevelop, but I can’t get it to work. I clicked the checkbox in Unity to allow attaching debugger to Editor, but when I choose Attach from the solution in MonoDevelop, there is nothing listed in the Process Name area.
I’m on OSX. Am I missing a step to set this up correctly?
Though I can’t answer the question, at least I can confirm it does work in OS X, so it’s not a general problem. When I open the “Attach to Process” window I see two processes, null(mono) and Unity Editor(placeholder). It all just worked after I upgraded to 3.2. Perhaps a reinstall might be needed?
I had the same problem on OSX. It seems that the issue happens when MonoDevelop calls out to get a list of attachable processes according the the source listing for AttachToProcessDialog. I can actually get this to work correctly if I run as admin. I never run developer as admin and have a separate account for admin stuff. It seems that permissions may be to blame for this. If I run MonoDevelop as my admin account the exception below does not happen and everything works. There are a couple of issues like this with MonoDevelop… one of them is a Unity bug with the monodevelop start script packaged with Unity. My coworker filed a bug on this.
Here is what shows up in the MonoDevelop log:
ERROR [2011-06-03 14:08:26Z]: Could not get attachablbe processes.
System.InvalidOperationException: Process has exited, so the requested information is not available.
at System.Diagnostics.Process.get_ProcessName () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ProcessName ()
at MonoDevelop.Debugger.Soft.Unity.UnitySoftDebuggerEngine.GetAttachableProcesses () [0x00000] in :0
at MonoDevelop.Debugger.DebuggerEngine.GetAttachableProcesses () [0x00000] in :0
at MonoDevelop.Debugger.AttachToProcessDialog…ctor () [0x00000] in :0
I had the same problem with Unity 3.4.1 + MonoDevelop 2.4.2. Solution was MonoDevelop > Tools > Preferences > Add-ins > Add-in Manager … > Debugging > Mono Soft Debugger Support for Unity – somehow this add-in had become disabled, all I had to do was click the Enable button.