Reliably debugging C# script?

I am using Unity 4.0.1f2 on Windows 8 64 bit.

I am finding it hard to reliably debug my script. I find if I run “Debug” from MonoDevelop with F5 then I get the following error:

So I shut down Unity with my project. I then hit F5 again and this time Unity starts, I can then set breakpoints and debug my code fine.

However if I stop the in game view, and then set more breakpoints then press play again the new breakpoints, and even the old breakpoints, aren’t recognised or hit.

So basically everytime to debug I have to kill Unity, then hit F5 in MonoDevelop, then when Unity starts hit the play button - which is a very slow work flow.

How should debugging actually work? Is there some way I am meant to attach to processes rather than hit F5 to debug?

I figured this out. I was hitting “stop” for debug in MonoDevelop. If I just leave it “running” then I can edit stuff, press “play” and “pause” in the unity viewer and everything is fine. Just important not to “stop” debugging in MonoDevelop.