Search Unity

4.3.x MonoDevelop Breakpoints not working

Discussion in 'Editor & General Support' started by Saishy, Dec 6, 2013.

  1. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    List of bugs:

    Windows 7

    Breakpoints not working
    http://puu.sh/5DHbF.png
    Frequency: Always
    Fix: Nothing works.
    Tried: Waiting. Starting and closing debug many times. Restart. Reinstalling. Completely removal and install. Manual attaching. Turning debugging off/on.

    THIS IS DRIVING ME NUTS, I BASICALLY CAN'T WORK ANYMORE AS A PROGRAMMER BECAUSE THE DAMN THING DON'T WORK!!!!

    Monodevelop won't open
    Frequency: Very often
    Fix: Go to Task Manager and kill monodevelop process, try again.

    Monodevelop squared text
    http://puu.sh/5D44Z
    Frequency: Often
    Fix: Go to Task Manager and kill monodevelop process, try again.

    Everything sucks and I want to kill everyone
    Frequency: Always
    Fix: FIX MONODEVELOP BREAKPOINTS
     
    MaisonDX likes this.
  2. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    No answer yet, still can't work.
     
  3. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    Installed UnityVS, uninstalled, breakpoints are now working in monodevelop (????????)

    Edit: Step Over, Into and Out not working, all of them jump to the next breakpoint.
     
    Last edited: Dec 7, 2013
  4. Cyclonus

    Cyclonus

    Joined:
    Nov 16, 2013
    Posts:
    1
    I have the same problem, and I seem to finally have a working debugger again. Hopefully it's not too soon to tell.

    This is what seems to have worked to get the MonoDevelop debugger working [haven't tried UnityVS at all, so can't comment on that]

    From Unity > Assets > Reimport All


    Good luck.
     
  5. Isbanan

    Isbanan

    Joined:
    Sep 12, 2012
    Posts:
    13
    I had this too, sometimes they work sometimes they don't who the hell knows why.
     
  6. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    Actually I tried that to no avail before, and I had the same problem again after and it vanished in a few minutes...

    Seems totally random about everything, when it happens, how much it lasts...
     
  7. kihu

    kihu

    Joined:
    Dec 17, 2013
    Posts:
    1
    Yup, I keep having all the issues OP described. This is ridiculous.
     
  8. Lardalot

    Lardalot

    Joined:
    Jun 19, 2013
    Posts:
    10
    Same here, breakpoints sometimes work, and sometimes they don't. Completely random, completely frustrating!

    When Mono is not attached attached to Unity the breakpoint marker is a solid dot, then soon as I attach it goes to the empty circle...and doesn't work.
     
  9. TheMaster42

    TheMaster42

    Joined:
    Mar 31, 2013
    Posts:
    4
    Having the exact same issues described. Monodevelop breakpoints seem to be completely inoperative. They appear as empty circles now when I place them, instead of a solid dot as before.

    Monodevelop also frequently won't open, have to kill the process as described in OP.
     
  10. mecharius

    mecharius

    Joined:
    Jan 11, 2014
    Posts:
    20
    Exact same issues here. Restarting Unity and MonoDevelop sometimes works for me and sometimes doesn't. Sometimes breakpoints that were present when you started debugging work but new ones don't.

    In addition to the issues above I also get the one where the tabs can no longer be clicked to change the active document or close a document. Keyboard shortcuts still work but the tab UI becomes unresponsive.

    Having to restart MonoDevelop/Unity every 20 minutes or so to keep basic functionality.

    Unity 4.3.2f1
    MonoDevelop 4.0.1
    Win 7
     
    Last edited: Jan 17, 2014
  11. Skiriki

    Skiriki

    Joined:
    Aug 30, 2013
    Posts:
    69
    So I had this issue just a few moments ago, here's what I did to fix it:

    Close Unity
    Close Monodevelop (and kill any lingering processes via TaskManager)
    Delete LibraryFolder
    Delete MonoDevelop Cache (for Win7 it's located at: C:\Users\<YOUR USERNAME>\AppData\Local\MonoDevelop-Unity-4.0 )
    Restart PC

    The most important part is probably deleting the cache though.

    Also, before this issue occured, I tried to attach the debugger ,while the game was running. It couldn't move a .dll and after that,breakpoints got ignored (and their red dots where desaturated as soon as I attached it to the UnityEditor process, game running or not).
     
  12. JSwanFin

    JSwanFin

    Joined:
    Apr 10, 2013
    Posts:
    19
    Thank you for so much for this. I just couldn't get debugger working on my Mac. Unity3D would just hang if I tried to debug with MonoDevelop attached. After deleting ~/Library/Cache/MonoDevelop-Unity-4.0 everything seems to be working again. Thx again!
     
  13. JSwanFin

    JSwanFin

    Joined:
    Apr 10, 2013
    Posts:
    19
    Maybe spoke too soon. Now it is beach ball of death again when trying to debug. I'll try to remove the Cache again to see if that makes a difference.
     
  14. JSwanFin

    JSwanFin

    Joined:
    Apr 10, 2013
    Posts:
    19
    Removing Cache files didn't make a difference this time. Maybe I should do some additional steps, like restarting the computer...

    I really hate the thing that the debugger doesn't work, hopefully it will be fixed soon.
     
  15. poulpator

    poulpator

    Joined:
    Oct 7, 2012
    Posts:
    11
    Hi,
    I have the same problem since installing Unity 4.3, never had it before. The problem did not appear immediately, it worked for a few days then the breakpoints stopped working. I am not aware of any "special" manupulation that could have caused the problem...

    I did the Delete LibraryFolder / Delete MonoDevelop Cache / Restart PC manipulation and it works again, hopefully it won't happen too often...
     
  16. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    Hi there,

    - First of all, can I ask, which version of Unity are you currently using?

    - Does this happen on one particular project, or can you create a project from scratch (e.g. with one C# script) and find that you get this problem?

    - Do you have another PC which you can try running the same version of Unity on to see if the problem is limited to just one PC?

    - Did this start happening after a certain event (e.g. upgrade of Unity or and upgrade of some other software on your PC)?

    Dave
     
  17. poulpator

    poulpator

    Joined:
    Oct 7, 2012
    Posts:
    11
    Hello again,
    I kinda found what causes the problem in my situation.
    Basically after one hour or so I get a "moving file failed" error
    $moving file failed.png
    (same problem as in this thread:
    http://answers.unity3d.com/questions/137599/moving-file-failed.html )
    if I click on "retry" the dialog pops again immediatly, if I click on "force quit" I can save the situation (but I have to restart Unity), and if I click on "Cancel" things keep working but the Unity/Monodevelop link gets broken somehow and the breackpoints won't work anymore.
    I tried to disable all the programs which could access the files (MacAfee real time analysis, iDrive backup), to deactivate file indexation, to launch monodevelop and Unity as Administrator, but I still get the Moving File error.

    As a side note I have a warning at launch since I upgraded to Unity 4.3.4f1: "Couldn't set project path to c:\Unity Projects\Solum\Assets", it does not stop things from working, so I don't know if there is a relation with the other problems or not.
     
    Last edited: Feb 18, 2014
  18. poulpator

    poulpator

    Joined:
    Oct 7, 2012
    Posts:
    11
    Hi Dave, to answer your questions:
    - I use Unity 4.3.4f1, I did not have this problem before. I was able to work for a day or so without this problem, but now I get it very regularly.
    - I can't test right now if the problem arises on another project/machine since i'm in a rush and the problem appears randomly after an hour or so. I will try to test that when I have more time..
    - no recent software update, excepted PlayClaw5 (video capture)
     
  19. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    So did the problem start to happen with 4.3.4, and not happen with 4.3.3 ?
    What happens if you use 4.3.3 ?
    And did you say you think it is connected to the "moving file failed" problem?
     
  20. poulpator

    poulpator

    Joined:
    Oct 7, 2012
    Posts:
    11
    I upgraded directly from one of the last Unity 3.x versions to 4.3.4, so i wouldn't know if it would have done the same with 4.3.3.
    And in my case (don't know about the topic creator), it's definitely bound to the "moving file failed" problem, I have been able to reproduce it a few times now:
    1) I use Unity for a while...
    2) the moving file failed dialog appears, I press cancel
    3) the breackpoints don't work anymore, even when restarting everything/rebooting
    4) I delete the LibraryFolder and the MonoDevelop Cache, reboot...
    5) Goto 1)
     
  21. zenforhire

    zenforhire

    Joined:
    Nov 5, 2012
    Posts:
    65
    All the same problems as Saishy when upgraded to 4.x versions to 4.3.4
    it starts with the "moving file failed"
    I don't see a solution in this thread?
     
  22. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    Poulpator: can you go into more detail into 1 and 2 at all? How often does it happen? Presumably there are many people who are using Unity 4.3.4 (myself included) and aren't seeing the 'moving file failed' dialog, so logically there must be something specific to the PC setups in this thread which are trigging this to happen.
    My guesses would be:
    - Anti Virus
    - Game still running and 'locking' these files
    - Aliens

    One course of action to get to the bottom of it would be to, when it happens, see if you yourself can access (delete, rename, whatever) the file in question. If you can, that would probably mean that the file was just inaccessible for a short period of time (which sounds like Anti-Virus).
    If you can't, that would probably mean that there is an process still running which is locking that particular file. All that remains is to narrow down which process it could be. I believe you can also get software which will tell you which process is using a particular file (This maybe?: http://www.emptyloop.com/unlocker/ ). Recommendations on this kind of thing welcome, I haven't used anything before personally.

    I presume 'Saishy' who originally started this thread is long gone...
     
  23. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Just to weigh in here, I'm having the exact same problem. It's getting pretty annoying, even re-installing Unity completely is not helping :(

    I can't yet verify if this is related but it seems that I started having this problem soon after installing a couple express versions of Visual Studio.

    Edit: Also in my case it seems that breakpoints are only not working for certain files. In one script they don't work but in others they work fine. Of course I'm still having issues with the MonoDevelop Project getting out of sync.
     
    Last edited: Mar 25, 2014
  24. Driskard

    Driskard

    Joined:
    May 20, 2012
    Posts:
    8
    I have the same problem.
    $unity_error.png

    This occurs 2 to 3 times a day because the file Library/ScriptAssemblies/Assembly-CSharp.dll.mdb is locked by MonoDevelop. When this happens, I simply close MonoDevelop, click Try Again then re-open MonoDevelop.
     
  25. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Ok well now I'm officially at my wit's end. I did a complete re-install of windows and right off the bat breakpoints still weren't working, and any error would cause Unity to totally crash. Then I got the Moving file failed error, closed Mono and now Mono won't open at all.
     
  26. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    I'm facing the same problem while debugging on Android device: attaching to AndroidPlayer, breakpoints got desaturated and ignored. Even after deleting MonoDevelop-Unity-4.0 cache. The main development is under Visual Studio 2013 Express; MonoDevelop is used only for debugging.

    Unity 4.3.2f1 Pro
    Windows 8.1 Pro
     
  27. AlejoS

    AlejoS

    Joined:
    Jun 21, 2012
    Posts:
    4
    Looks like running monodevelop as administrator fixes the problem. (and reimporting a script)

    Its probably a OS blocking read/write files or something.

    To repeat the bug

    1) Attach monodevelop to Unity
    2) Set a breakpoint
    3) Execute
    4) When the breakpoint is reached, click on play to continue (in monodevelop)
    5) Modify the code and save
    6) Get back to Unity

    When triying to recompile, the Pop up shows up, crashing monodevelop and breaking the break points if you click on cancel.
     
    Last edited: Mar 31, 2014
  28. dmitche3

    dmitche3

    Joined:
    Apr 3, 2014
    Posts:
    23
    I'm just getting started with Unity and Mono and I'm having these problems as well.

    I consider myself still in the "pondering" stage of using Unity as I only have about 3 weeks invested into it. While Unity is one thing, the interfacing with Mono is, cough, makes me a bit ill.

    The problem Mentioned above with the "Try again" to copy the executable code is caused by Mono having the code locked up, or in other words it is still attached to the code for debugging. Detach and then hit "Try again" and it works.

    I have all of these problems and now the break points. This makes Unity worthless if one cannot debug it. I've had to uninstall Unity once already as it kept complaining about a library being within a library, or something silly like that. So when it started all it would do is put out a garbage message and shutdown. Since I'm new and didn't do much other than use it to simply add objects to the Hierarchy I was and still am surprised.

    But back on topic, is there ANY relief to fixing breakpoints? I haven't found anything on the net but not being able to step into a method is not much of a debugger. And as I'm still evaluating this development platform I'm not willing to spend $100 to use Visual Studio to debug, and then find out that Unity is more hype and hacking then usable. :(

    I'm using 4.3.4f1.

    Question. I noticed that when I attach to Unity now that the textbox is empty. The one that says "Attach To". I don't know what was in it before as I ignored it and double clicked on Unity, but perhaps the tool is programmed in some strange fashion that some value has to be in the field to have it work correctly.
     
    Last edited: Apr 4, 2014
  29. dmitche3

    dmitche3

    Joined:
    Apr 3, 2014
    Posts:
    23
    Thank God for backups. Restoring my project to yesterday's backup and Mono is working again. As only the project and files were restored (no Unity code) this points to project settings somehow messed it up. Comparing the SLN and other files don't show me anything that I recogninize as unusual, but I'm green at Mono and Unity.
     
  30. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    This is a tangent, but comments like 'thank god I make a backup yesterday' terrify me.
    Please, everybody, if you aren't already, use source control: it's really important. There are many fantastic source control packages out there. If there are any barriers to entry I would be happy to provide/link to a short tutorial somewhere about how to set up the popular ones.

    Personally there is no way I would ever do any kind of hobby or professional development without a source control system, ideally with backup to another computer somewhere at least in my house, and at best somewhere else on the internet, in place. This is nothing to do with Unity, this is just for sanity.


    Anyway, back on topic: I still feel we haven't got to the core reason why these files are being locked. Going back to my original comments on this, it would great if somebody could provide more information:

    When it happens, see if you yourself can access (delete, rename, whatever) the file in question. If you can, that would probably mean that the file was just inaccessible for a short period of time (which sounds like Anti-Virus).
    If you can't, that would probably mean that there is an process still running which is locking that particular file. All that remains is to narrow down which process it could be.
     
  31. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    Quick question. When this happens ( Library/ScriptAssemblies/Assembly-CSharp.dll.mdb locked ), is this not simply because MonoDevelop is attached to Unity.exe, you edited code and then you switched to play mode again? I can reproduce that quite easily.

    If that happens go to MonoDevelop, click Run | Detach, go back to Unity Editor and click Try Again (to copy Assembly-CSharp.dll.mdb), and then to debug again just reattach MonoDevelop to Unity.exe.

    Is that what this entire thread is about, or is it something more complicated?
     
  32. baal130

    baal130

    Joined:
    Jul 26, 2013
    Posts:
    1
    Yes this occurs, when changing code of attached script in play mode. But what to do if click Cancel (to copy Assembly-CSharp.dll.mdb), then u can't get breakpoints work properly again?
     
  33. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    Don't click 'cancel'. Go to MonoDevelop, detach, and click 'try again'.
     
  34. eschoell

    eschoell

    Joined:
    Apr 14, 2014
    Posts:
    1
    Not hitting "Cancel", and going back to MonoDevelop, and hitting detach is good to know in the future. But if we had ALREADY hit cancel, and our breakpoints are now screwed, how do we unscrew them? Nothing I've found (in this thread, or others) has worked.
     
  35. dmitche3

    dmitche3

    Joined:
    Apr 3, 2014
    Posts:
    23
    Well, I won't take this personally that God terrifies you. :) But as source control IS one of my two methods of backup, yes. But no hobby or professional development without another form of backup other than source control would be even more foolish. To rely on a single copy or single location for your 'backup' is asking for disaster.
     
  36. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    If you have cancelled, delete Library/ScriptAssemblies. Then you should either right click on your Scripts folder and click re-import or restart Unity.

    We have this problem here on every machine. The frequency of it happening is very variable but it's not anti-virus related, it happens with it disabled as well and the project folder is on the ignore list anyway.

    It started happening with Unity 4.3/MonoDevelop, when recompiling while the debugger is attached. The odd thing is, recompiling doesn't always cause it, most of the time it works just fine, it's as if the debugger occasionally keeps the .mdb files locked.
     
  37. bawenang

    bawenang

    Joined:
    Aug 18, 2012
    Posts:
    119
    The same thing happened to me. The failed to move error showed up and then break points can't be used afterwards.
     
  38. LymanCao

    LymanCao

    Joined:
    Oct 16, 2012
    Posts:
    14
    I have the same problem!!!
     
  39. Dirtnap

    Dirtnap

    Joined:
    Apr 6, 2014
    Posts:
    2
    Is this still a problem? I think I am debugging correctly for Unit 4.3.2f1, but I'm not hitting breakpoints and I'm brand new to unity. I followed the debugging steps earlier in the thread.... Any help?
     
  40. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    ... Did recompiling with the debugger attached work before 4.3? If so this is a regression.
     
  41. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Yes, it is a regression. We had never seen this problem before 4.3/MD4.0. It specifically became obvious because it manifested itself in a usage pattern we had been using for a year, keeping the debugger connected, stopping the game and recompiling.
     
  42. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    Have you submitting a bug report? If so, do you have the bug id?
     
  43. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    I did not, because there were so many threads about it here and on Answers that I thought it'd be well reported already! If not, I can file one but it is tricky, as it is so intermittent that I cannot really submit a use case that consistently triggers it. I'll see if I can come up with an example project that does this frequently.
     
    Last edited: Apr 22, 2014
  44. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    This is, I am finding, a frequent problem with Unity bugs. There is often a huge amount of talk on forums about a particular issue, and everyone assumes there there must be a bug in the system and so it will be fixed. Sometimes this isn't the case: sometimes there isn't a bug in the system because everyone assumed that someone else will have done it! There was something along those lines in the thread about the Oculus Rift not launching on the correct adapter, everyone agreed it was super-important, yet no-one had submitted a bug.

    It is a pain to take the time to submit a well written bug with clear repro steps and a nice minimal repro project, I admit, but it's really important.
    Submitting a bug is good in any case because it means you get feedback via e-mail when it gets reproduced locally and when it gets fixed.
     
  45. alexul

    alexul

    Joined:
    Apr 26, 2014
    Posts:
    1
    For me it worked by simply re-importing the scripts. Thanks.
     
  46. KarbonatErol

    KarbonatErol

    Joined:
    Oct 1, 2013
    Posts:
    4
    A little bit old thread, but I might have found the solution. It appears that the files become locked because of adb.exe (it's the Android thingy). Simply kill adb.exe, delete your library files, open up your project, sync monodevelop project, put your breakpoints back, attach to process and press play, voila!
     
  47. Johnny-Ge

    Johnny-Ge

    Joined:
    Apr 26, 2014
    Posts:
    11
    It worked for me. But the cache file always exist file, it means deleting the files before debugging each time...

    Thanks anyway!!
     
  48. ricardo_arango

    ricardo_arango

    Unity Technologies

    Joined:
    Jun 18, 2009
    Posts:
    64
    I don't think you need to delete the "Library files". If you do, Unity will reimport your whole project. Inside the Library folder also lives the ScriptAssemblies folder, with the dlls and mdb files. That's more likely the folder that you may want to be deleting. Although a reimport of a single script in the Project should have the same effect.
     
  49. KarbonatErol

    KarbonatErol

    Joined:
    Oct 1, 2013
    Posts:
    4
    I knew that it was something about the library folder but I couldn't be sure, so I just deleted the entire folder, which seemed to work. Anyway, the culprit is adb.exe which locks some files (probably "a" file) in ScriptAssemblies as you said. However, I am not sure why adb.exe is locking files, let alone running when you don't even select the publishing platform as Android.
     
  50. ricardo_arango

    ricardo_arango

    Unity Technologies

    Joined:
    Jun 18, 2009
    Posts:
    64
    The issue is not related to adb.exe. We now have a 100% reproducible project which happens with or without adb.exe running. That's very good news as now we can investigate the real cause of the problem.