Search Unity

MonoDevelop Feedback

Discussion in 'Scripting' started by lukaszunity, Dec 14, 2015.

  1. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    After Unity 5.3 with MonoDevelop 5.9 has been released, some Unity developers have been using the comments on the MonoDevelop Roadmap blog post to ask questions and provide feedback.

    I don't think the comments in blog post is the best place for discussion, so I've created this thread for that purpose instead.
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,077
    The only niggle I've got with it compared to the previous version, is that when typing Debug.Log, previously I only needed to have typed Debug.l and then autocomplete would add the rest. But now Debug.l results in an autocomplete of Debug.logger. So I I'm constantly having to correct it until I get out of my old habit.

    That aside, nothing to complain about, and it works well for me.
     
    Aisaka-Taiga and Magiichan like this.
  3. ilTechnicus

    ilTechnicus

    Joined:
    Dec 14, 2015
    Posts:
    2
    I mainly use JavaScript and after the update shows me many more errors in the code. Especially if I omit the end of calculation ";" or use "=" instead of "==" and the opposite.

    Example:
    - prints ("es") // does not show the error
    - bannerXX.visible = true // does not show the error
    - etc ..

    Unity 5.3 - OS X 10.11.2 - MacPro 3,2 GHz Quad-Core Intel Xeon
     
  4. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    918
    On my Mac (El Capitan) there's a process called mono-sgen that seems to take more and more memory over time, finally freezing MonoDevelop and requiring me to force restart it.

    Besides this, all is well so far.
     
  5. JackTheNerd

    JackTheNerd

    Joined:
    Nov 12, 2015
    Posts:
    1
    Hi, I am using a Mac (10.9.5) and I have been experiencing problems w/ the new Monodevelop, it just won't autocorrect or predict anything for Java/UnityScript, please get this fixed as soon as possible, as this has really halted my game's progression. All I did was open up unity and try to programme, but then it just stopped working
     
  6. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Are these syntax highlighting errors or build errors?

    mono-sgen is the Mono .NET runtime that MonoDevelop runs on. It could sound like Mono is leaking memory over time. Could you open a bug report in Unity after you get a freeze? It will attach the MonoDevelop logs and we can investigate based upon the logs.

    There is no auto-completion for UnityScript/Boo in MonoDevelop 5.9. You can still use MonoDevelop 4.0.1 for this. We recommend that users switch to C# for Unity development.
     
  7. ilTechnicus

    ilTechnicus

    Joined:
    Dec 14, 2015
    Posts:
    2
    The errors have been written as an example. When I run Build with MonoDevelop, it is not reported as errors.
     
  8. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    I'm sorry but that's kind of ridiculous...
    I have always found C# to be messy, counter-intuitive and needlessly complicated. Why would I want to switch to it?
    70% of all the scripts in my game are JS and 100% of the scripts I wrote/am writing are JS. It's completely illogical to HAVE to convert them all to C# if I want to use 5.3 and it's features, especially when you guys posted in one of your blog posts that around 30-40% of all the scripts created with MonoDevelop were UnityScript. And, I mean you called it UnityScript for crying out loud...

    Also, I have tried to use MonoDevelop 4.0.1 with Unity 5.3, but the Autocomplete still would not work for JS...
     
    Yann likes this.
  9. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    Also, you kind of say that like it's no big deal... Well for people that worked exclusively in UnityScript for years, and work on projects with tight 3 week deadlines, it is a big deal.
     
  10. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    You can still build your UnityScript/Boo projects and this will continue to be supported.

    I don't think anything has changed in Unity 5.3 that would affect auto-completion for UnityScript in MonoDevelop 4.0.1.
     
    Last edited: Dec 19, 2015
  11. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    Maybe I am not installing it correctly. The only way I found to install an earlier version of MonoDevelop was to install an earlier version of Unity...
    Is there another way to do it?
     
  12. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    You should be able to just overwrite MonoDevelop 5.9 in Unity 5.3 with MonoDevelop 4.0.1 from an earlier version of Unity.
     
  13. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    OK. I'll try that.
     
  14. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    I am having another issue with the Editor and Monodevelop. For some reason the Editor does not update when I make changes in any script. I have to right click and select Refresh for the script changes to register.
     
  15. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    Same when adding a new asset. If I export an FBX from some software into the Assets folder of the project it will not show up in Unity until I click Refresh.
     
  16. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    78
    Never mind :p
    Apparently the Auto Refresh is off by default in Unity 5.3.
     
  17. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    299
    when I create new C# files in Unity, then try to edit them in MonoDevelop, I can't do anything? I can't type in the file at all, but i can cut for some reason.

    anybody know what is happening here?
     
    pjw9000 likes this.
  18. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Are you on Windows? You might have multiple installations of GTK#. Try to uninstall them and then reinstall GTK# from here: http://www.mono-project.com/download/#download-win and restart your computer.
     
  19. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Ok, don't know if this is the right place or not, but here is my gripes with Unity 5.3 and MonoDevelop 5.9...

    Overall, i feel Unity pushed a version of MonoDevelop that is not actually stable at all.. Its about as stable as a game of Jenga after a few rounds.

    1) Switching projects in unity and attempting to double click a source file in order to edit it causes MonoDevelop to crash when it attempts to switch projects. You have to close the project in monoDevelop, and open the other project yourself... Even then clicking double clicking a file in unity (that would launch to monoDevelop) seems a 50/50 chance to crash monoDevelop.

    2) MonoDevelop randomly decides to unload parts of the assembly while debugging causing it not not break where you have break points... there seems to be no rhyme or reason as to when or why. This happens in EVERY project. In order to fix it you have to stop the editor, break the connection from monoDevelop to Unity, reconnect, and then it will work for a while again. There is nothing to tell you this has happened either, it just doesnt break when it should. However if you then go to remove or set a break after this has happened monoDevelop will give you a popup telling you its unloaded that section from memory.

    3) Its always nice to have it crash randomly on coroutines... this only happens if you are debugging the project, and again with no rhyme or reason. Happens in multiple projects with completely unrelated code. Keep in mind this does not happen with same project with previous version on monoDevelop. Of course there is the added bonus that if monoDevelop crashes while in debug mode and hitting a break point there is no way to unpause it in the editor, thus you have to force quit the editor...hope you saved your work..... and while not related.... seriously version 5.3 and there is no "save on play" option? That's just lazyness imho.

    Keep in mind that all of these problems happen on multiple different projects that are completely unrelated...

    Don't get me wrong, I love unity its great, but it really feels like someone said "Ah #%$^ it, ship it anyways" when it came to issues with the current version on monoDevelop pushed with 5.3. I find it especially hard to believe that Issues 1 & 2 where not experienced by Unity devs during testing.
    Yes you can of course roll back to a different version of monoDevelop, but um, i will point out Unity is supposed to be a commercial product, which you would expect to work properly out of the box...and once again seems like a lazy answer to just tell people to use an older version, cause if that is the case why ship with 5.9 in the first place?

    That is all, enjoy your day.
     
  20. pjw9000

    pjw9000

    Joined:
    Jan 1, 2016
    Posts:
    3
    Seems like my issue is similar with what Drowning monkeys has. I can cut / delete scripts only if I select the blocks. I don't know what his OS is, but I am using Mac and my version is El Capitan. Any idea with it? Thank you in advance.
     
  21. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    ARRRGGG!!!!!!!
    This! All Day long This!!!!
    no_seriously_wtf.png
     
  22. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    And more again today, not just nice popup but in other places too.... Notice the nice text in red....

    again_wtf.png


    @lukaszunity
    Any response on this since i see in the 5.3 notes that this was SUPPOSED to be fixed, but it is not...
     
  23. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    1) Thanks for reporting this issue. We will investigate. Could you provide your MonoDevelop log when this crash happens? Help -> Open Log Directory.

    2) This whole ERR_UNLOADED issue is actually a problem in the Mono runtime, not handling AppDomain reloads correctly. AppDomain reloads happen in Unity when recompiling scripts and when entering play mode. The problem is that when an AppDomain is unloaded, all the types in the AppDomain are unloaded, but the Mono runtime does not inform the debugger of this correctly. So if the debugger is attached while a domain reload happens, the debugger thinks some types are still loaded, but they have in fact been unloaded. When you then request them in the Mono runtime you get the ERR_UNLOADED message. We have previously tried to fix this issue in the correct way, but that broke VSTU. We are still investigating other ways to fix this issue, until then the workaround is to reconnect the debugger.

    If you are still getting the ERR_UNLOADED with enums, could you please file a bug report? There might be more cases with the enums.

    3) Can you file a report for the co-routines bug?

    I think it should be possible to fix the issue with the editor being locked up if a breakpoint is hit (Mono runtime is suspended) and the debugger socket connection is closed. I've added this a task on the code editor team's backlog.
     
    Last edited: Jan 4, 2016
  24. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Could you provide some more details for this issue, so we can reproduce it?
     
  25. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    @lukaszunity

    Hey thanks for the response, i appreciate you taking the time to do so.

    1) Yes, I can do that for you. About to walk out the door but when i will get back ill make it crash and send one in.

    2) While i understand that the ERR_UNLOADED is an issue with the MD runtime, and that xamarian experiences the same issue, it falls back to my original post in this thread that a buggy unstable version of monoDevelop was pushed with 5.3 and really seems like someone screwed the pooch on this one. Why push a broken version of MD? Was there something the previous version were lacking that new features in Unity 5.3 required you guys to push a new version of MD? Or was it just new and shiny?

    Also, this happens even when I have not edited any source files. I can be running a program, debugging just fine, break point working just fine.... then poof its gone, no editing of anything. The only way you can tell it happened is it stops stopping at break points, or if you go to add a new one then it freaks out. It is also worth nothing that this can happen AS SOON as you start the program. I have hit play and had break points in Awake() on gameObjects that don't trigger, only to find out it decided to unload things right away.

    When i get back in later i will file a bug report.


    3) Yes, I will file a report for the co-routines. This one happens the most infrequently, and has occurred only a handful of times since switching to MD 5.9


    Thanks for the response again
     
  26. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    @lukaszunity

    I have filed a bug report for issue 1. I was unsure what category to put it under as i did not see one specifically for monoDevelop, so it is under "Crash", i removed the project (as this should crash with any two projects), and attached two log files. For some reason when i caused it to crash there was two log files made within seconds of each other, so i attached both.

    I will send bug reports for the other two issues later tonight, I have to clean up the project I would like to send along some as its a work in progress and a section of code is half done making it un-useable for testing purposes. I want to send this project specifically because the issue with ERR_UNLOADED on enums ive only seen twice before both times on this project. The issue with co-routines crashing is also more prevalent on this project because im making heavy use of them then i normally do in other projects.
     
  27. pjw9000

    pjw9000

    Joined:
    Jan 1, 2016
    Posts:
    3
    Well, first create a project, make a script and open it with monodevelop. There is nothing special with it. I recently started Unity so there is no add-on or anything. I remember clicking iOS part while installing, and setting a new path for my projects, but other than that I was just following tutorials.
    And seems like I am not the only person struggling with this issue. For example,
    http://answers.unity3d.com/questions/1112528/cant-edit-new-c-files.html
     
  28. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Thanks filing bug reports, the categories and such do not matter that much, we usually change them internally once we process the bug. The most important part is clear reproduction steps on a preferably small project, as this enables us to address the bugs faster.

    Could you post the bug number here so I can easily find them and assign them to the code editor team?

    We are very committed to fixing any issues that the developers are experiencing with MonoDevelop and are doing our best to find issues before we release a new version. We greatly appreciate any developers who take the time to provide feedback, good or bad, to help us improve the MonoDevelop experience.

    We decided to upgrade MonoDevelop because we had a bunch of open bugs that were fixed in later versions and we are now actively working on improving the scripting experience in MonoDevelop and it would not make sense to build these improvements on 2+ year old version.
     
  29. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Are you on Windows or OSX?
     
  30. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    @lukaszunity

    Bug Report for first issue: (Case 759049) MonoDevelop crashs when switching projects via Unity Editor

    Im finishing up cleaning up the other project now and will do bug reports shortly and update with case numbers here.
     
  31. pjw9000

    pjw9000

    Joined:
    Jan 1, 2016
    Posts:
    3
    As noted in my first post, I use OSX (Mac). Also my version is El Capitan.
     
  32. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Thanks. These issues have now been assigned to the code editor team.
     
  33. hexagonius

    hexagonius

    Joined:
    Mar 26, 2013
    Posts:
    96
    I also am facing an issue even after removing Unity and Mono from the Mac.
    Whenever I start MonoDevelop it shows a split Run Button and does neither let me debug the Editor nor anything else. A press on that button just compiles the project, nothing more.

    The Button looks like cut in half (can't upload screenshot here)
     
  34. hexagonius

    hexagonius

    Joined:
    Mar 26, 2013
    Posts:
    96
    I found that it had to do with messing with different installs which screwed "something" (don't know what exactly) under Library/Preferences related to Unity. So I deleted everything there essentially recreating the Unity preferences and it worked
     
  35. fschneider

    fschneider

    Joined:
    May 26, 2014
    Posts:
    42
    @lukaszunity
    When creating new methods, I used to simply write a call to that not-yet-existing method and then used the refactor feature of mono develop to let it create the method for me. I don't see that option in the context menu anymore, is it gone?
     
  36. hjacobsdesign

    hjacobsdesign

    Joined:
    Aug 4, 2014
    Posts:
    2
    I am having the same issue of not being able to edit a new script. I t
    It appears that Monodevelop now has version control on by default. This fixed the issue for me: go to Options/Version Control/General and tick "Disable Version Control Globally".
     
  37. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    I will try to see if this feature was removed or just works differently now.

    Thanks for the suggested fix! Can anyone else verify that this fixes the issue for them?
     
  38. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    91
    For me, MonoDevelop 5.9 is a big improvement from 4.0, so thanks for the update.

    That said, here is my short list of issues:

    1. Folding: Well, this was completely broken in MD 4.0 so big improvement here but it still does not function like it did in the MoneDevelop that came with Unity 4.2 or how Visual Studio handles folding. "Toggle Definitions" does as you would expect but what we really want is a function that always folds definitions, not toggles. Toggling between folded and not folded, only creates confusion and lose of place. We would prefer to use a separate command like "Unfold All" if we need to unfold.

    2. Syntax Highlighting: Can we get the unique (typically Blue) highlighting back on #if, #ifdef, etc. in both scripts and shader?

    3. Text Bug: This probably related to the folding, but every once and a while, random text will get shifted/pasted in a different location without reason and without an undo available.
     
  39. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Thanks for reporting these issues. We will look into them.
     
  40. jorsai

    jorsai

    Joined:
    Nov 13, 2015
    Posts:
    9
    I was searching why my MonoDevelop is not using autocomplete with JavaScript and I just find this...

    What? Really? JavaScript and C# are two differents ways to program, and now you are bounding JavaScript programers to move to C#, because you take away facilities. You are pushing a lot of people back to older Unity versions. I think I am not the first downgrading.
     
  41. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    I just want to clarify that we are not removing support for compiling UnityScript/Boo scripts in Unity and MonoDevelop. Nor are we removing support for opening UnityScript and Boo projects in MonoDevelop. So it is still possible to use the latest Unity version for developing in UnityScript and Boo.

    It is code completion for UnityScript/Boo that is no longer available in MonoDevelop 5.9 and we recommend that developers use C#.
     
    jorsai likes this.
  42. hexagonius

    hexagonius

    Joined:
    Mar 26, 2013
    Posts:
    96
    @lukaszunity I've spotted a solution to one of the mentioned problems:

    Problem: Right click on new method name does not show the refactor option for creating it.
    Solution: Under Tools -> Options in TextEditor -> Source Analysis enable "Enable source analysis of open files"
    Solution Problem: The method name needs to click, either by right or left click at least once. A tiny blue underline appears and the method name turns red. Right clicking it then shows up a Fix context menu with the "Create method" functionality.

    That's annoying and worked much better in the old Mono version (method name directly turned red and right clicking it showed the refactor option right away).
     
  43. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    I think this is unlikely to changed in MonoDevelop 5.x. Xamarin are now using Roslyn in Xamarin Studio/MonoDevelop 6 for refactoring operations. We will upgrade to version 6 once it is stable.
     
  44. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    574
    Often, I have a Unity crash when I do "Attach to process" to the Unity Editor and then I hit play.
    Unity crashes and the OSX popup appears for reporting.
    Sometimes it also happens that a process called Unity still runs after the crash. When I saw it the first time there was the main Unity process with the icon, plus two more of them without icon in the Activity Monitor process list.
    It's hard to understand what is causing it because my code is pretty big and complex.
    I'm running now 5.3.1p3 on OSX 10.10.5
     
  45. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    It sounds like a issue with the Mono script debugger server inside Unity. It has asserts that call exit(), so those would crash Unity. You should have a call-stack in the Unity editor.log after the crash that indicates whether this is the case. But without a repro case (preferably small) it hard to know for certain and a repro case would also be necessary in order to fix this.
     
  46. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    574
    Thanks for replying.
    Here is the error in the log. I hope it could help.
    In the meantime I'm updating Unity to the last version and patch.

    Reloading assemblies for play mode.
    Begin MonoManager ReloadAssembly
    Unity(935,0x117504000) malloc: *** error for object 0x60000027ecc0: pointer being freed was not allocated
    *** set a breakpoint in malloc_error_break to debug
    Stacktrace:


    Native stacktrace:

    0 libsystem_kernel.dylib 0x00007fff8f106286 __pthread_kill + 10
    1 libsystem_c.dylib 0x00007fff8dc0e9ab abort + 129
    2 libsystem_malloc.dylib 0x00007fff8e75a1cb free + 428
    3 libmono.0.dylib 0x0000000109cf1b4a g_free + 19
    4 libmono.0.dylib 0x0000000109be5651 mono_debugger_agent_handle_exception + 26978
    5 libmono.0.dylib 0x0000000109ce26c5 CreateThread + 1359
    6 libmono.0.dylib 0x0000000109d08d9d GC_start_routine + 96
    7 libsystem_pthread.dylib 0x00007fff92ab705a _pthread_body + 131
    8 libsystem_pthread.dylib 0x00007fff92ab6fd7 _pthread_body + 0
    9 libsystem_pthread.dylib 0x00007fff92ab43ed thread_start + 13

    Debug info from gdb:


    =================================================================
    Got a SIGABRT while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    [0129/145456:FATAL:platform_thread_posix.cc(235)] Check failed: 0 == pthread_join(thread_handle.handle_, __null) (0 vs. 3)
     
  47. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Looks like Mono debugger crashes when handling an exception, root cause of this issue might be somewhere completely different. Need to bug report with repro project to fix this.
     
  48. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    885
    This may not be a huge deal for others, but personally, I wasn't able to transfer my syntax highlighting color schemes from MonoDevelop included with Unity 5.2.2 to the one included with Unity 5.3.
     
  49. ManuuCarp

    ManuuCarp

    Joined:
    Feb 14, 2014
    Posts:
    3
    Okay, now , why that eliminated UnityScript support ? They are totally crazy ? A large part of users and uses UnityScript Now the want to " force " indirectly switching to C # ? Sorry for not speaking English 100 % , but you think twice about doing that , or they will lose a large part of users , which desert , they are already very angry .
     
  50. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Posts:
    408
    Unfortunately the highlighting schemes file format changed between MonoDevelop 4.0.1 and MonoDevelop 5.9.6, so the highlighting schemes need to be re-created in MonoDevelop 5.9.6.

    I'm am just going to repeat my answer from earlier in this thread:

    I just want to clarify that we are not removing support for compiling UnityScript/Boo scripts in Unity and MonoDevelop. Nor are we removing support for opening UnityScript and Boo projects in MonoDevelop. So it is still possible to use the latest Unity version for developing in UnityScript and Boo.

    It is code completion for UnityScript/Boo that is no longer available in MonoDevelop 5.9. We recommend that developers use C#.