Mono Can't Attach to unity ( for debug )

mono attach to unity sometime not work

mono show next message

Connection refused

System.Net.Sockets.SocketException:
Connection refused at
System.Net.Sockets.Socket.Connect
(System.Net.EndPoint remoteEP)
[0x000fa] in
/private/tmp/monobuild/build/BUILD/mono-2.6/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:526
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)
[0x0002b] in
/Users/levi/Code/github-repo/mono-unity/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs:247

then i restart unity and mono

how can i fix? not restart program

This sometimes happens on OSX, after the Unity editor is force-killed or crashes.
It will be fixed when we’re able to ship MD Unity edition with a newer version of Mono.

  1. Are you sure you use the monodevelop that comes with your unity installation?
  2. If yes, sure there is no software firewall messing in?

I ask cause I debug on Win7 Ultra 64Bit as well as OSX 10.6.7 with the monodev that comes with unity and don’t have any problem.