Search Unity

[Solved]Debugging with Unity3 on Windows

Discussion in 'External Tools' started by Metron, Jun 29, 2010.

  1. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    977
    Hi everyone,

    I'm failing at debugging my game using MonoDevelop and Unity 3. I have installed the latest mono distribution (without xps and gtk) but the debug button keeps grayed out.

    Does anyone have a hint how to set up my machine to be able to debug ?

    Thanks and have fun...
     
  2. HJP

    HJP

    Joined:
    Jul 8, 2009
    Posts:
    152
    I have the same problem. Maybe someone can help so ...
     
  3. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
    Until the right person appears and explains everything as needed, I'll try to help out.

    Anyways, here are the simple steps:

    1. Open MonoDevelop
    2. Go Tools->Preferences, scroll down to Unity->Debugger
    3. Set Editor Location
    4. Now you need some scene to play with, create a basic scene, add some simple C# script
    5. Execute Assets->Sync MonoDevelop Project, this will create *.sln file which is needed by MonoDevelop
    6. Close UnityEditor
    7. From the MonoDevelop, open up created *.sln file
    8. Setup some breakpoints in your C# script
    9. Run->Run With->Unity Debugger
    10. The UnityEditor should open up
    11. Press Play button
    12. MonoDevelop should stop at the breakpoint you've setup

    Hope that helps
    :roll:
     
  4. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    977
    Thank you so much :)

    It all works now *thumbsup*
     
  5. HJP

    HJP

    Joined:
    Jul 8, 2009
    Posts:
    152
    O.k., I think, I have the wrong version of MonoDevelop.
    Unfortunately the download link does not function. I get a 404 error for the Mac Version.
     
  6. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
    Btw., Those instructions were for MonoDevelop on Windows

    But it should be similar for Mac also
     
  7. kork

    kork

    Joined:
    Jul 14, 2009
    Posts:
    265
    Well it seems you need to download the version of MonoDevelop from the Unity guys. The "official" MonoDevelop has no Unity-Addin. Too bad that the Mac version download link is broken :(
     
  8. HJP

    HJP

    Joined:
    Jul 8, 2009
    Posts:
    152
    Solved ... Thanks
     
  9. eheimburg

    eheimburg

    Joined:
    Apr 1, 2009
    Posts:
    27
    I can't get the debugger to go at all. I mean, literally, when I start MonoDevelop.exe it simply disappears after the loading bar.

    This is the Unity-provided link to MonoDevelop, running under Windows 7. Has anybody else had this problem or know what I'm missing?
     
  10. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
    Windows 7 32 bit or 64 bit?
     
  11. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    I have the same problem.
    I'm using Windows 7 64bit.
    When I try to start it I get a message that there is something wrong with an addin.
    After that it doesn't startup and simply disappears.
    See the log.txt file.
     

    Attached Files:

  12. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
    I've ran MonoDevelop on a colleague's PC with windows 7 64 bit, and it runs okay.

    I suggest to fill a bug report with detailed info maybe the problem is elsewhere
     
  13. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    But was it the latest version that came with unity 3 beta 3?
    Also when I istall MonoDevelop 2.4 from the official website it runs fine.
     
  14. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
    Yes, just in case re-downloaded from link provided in Unity Beta Test group and it ran okay.

    So it's the latest
     
  15. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    Ok, thanks for testing. I will see if I can fix it :)
     
  16. redwildfire13

    redwildfire13

    Joined:
    Nov 6, 2009
    Posts:
    7
    I am having the same issue with MonoDevelop not starting on Windows 7 x64. I tried running it from where I zipped it, I installed the GTK# from the MonoDevelop home site and tried again. I tried moving the folder to "Program Files(x86)" and even tried installing MonoDevelop and dropping the in extra unity files with it.

    Has anyone found a way to make this work or am I still missing something? I really want to use the debugger!

    Thanks!
     
  17. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    I've tried also to install it with no success :(
    I'm using Win 7 64bit and first I got an un unhandled exception. After that I only see the splash screen and then it stops.
    When I view the log.txt I see all kinds of errors like this one:
    ERROR: There was an error while scanning assembly: C:\MonoDevelop_for_unity\bin\asprintf.dll expect assembly-manifest

    Hope this information helps finding the solution.
     
  18. Tak

    Tak

    Unity Technologies

    Joined:
    Mar 8, 2010
    Posts:
    962
    Hi guys,
    There was an issue with one of the windows builds that got released.
    It will be fixed for the next beta.

    As a workaround, you can remove duplicated dlls from the AddIns/ and AddIns/BackendBindings/ directories:
    basically anything that's in bin/ shouldn't also be in AddIns/, and nothing from bin/ or AddIns/ should also be in AddIns/BackendBindings/
     
  19. bst

    bst

    Joined:
    Jul 9, 2010
    Posts:
    1
    Never mind check the post above.
     
  20. jtingato

    jtingato

    Joined:
    Jun 20, 2010
    Posts:
    1
    The downloaded MonoDev did not come with an installer. How is everyone installing. Are we supposed to install from MonoDevelop.com then replace the files with the ones from Unity?

    Seems kinda silly
     
  21. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,514
    Tak, thanks. In the version of Mono Developer that comes with Unity b3 for windows, following Tak's instructions, I ended up with the following structure that works :

    Addin folder content ----------------------------------

    BackendBindings
    ChangeLogAddIn
    MonoDevelop.AspNet
    MonoDevelop.AspNet.Mvc
    MonoDevelop.AssemblyBrowser.dll
    MonoDevelop.AssemblyBrowser.pdb
    MonoDevelop.Autotools
    MonoDevelop.CodeMetrics
    MonoDevelop.Debugger
    MonoDevelop.Debugger.dll
    MonoDevelop.Debugger.pdb
    MonoDevelop.Debugger.Soft
    MonoDevelop.Debugger.Soft.Unity
    MonoDevelop.Deployment
    MonoDevelop.DesignerSupport
    MonoDevelop.DesignerSupport.dll
    MonoDevelop.DesignerSupport.pdb
    MonoDevelop.Gettext
    MonoDevelop.GtkCore
    MonoDevelop.HexEditor.dll
    MonoDevelop.HexEditor.pdb
    MonoDevelop.Moonlight
    MonoDevelop.MsVisualStudio
    MonoDevelop.Refactoring
    MonoDevelop.Refactoring.dll
    MonoDevelop.Refactoring.pdb
    MonoDevelop.RegexToolkit
    MonoDevelop.SourceEditor2.dll
    MonoDevelop.SourceEditor2.pdb
    MonoDevelop.TextTemplating
    MonoDevelop.WebReferences
    MonoDevelop.XmlEditor
    MonoDeveloperExtensions
    NUnit
    VersionControl
    WelcomePage
    WindowsPlatform.dll
    WindowsPlatform.pdb

    bin folder content --------------------------------------------

    asprintf.dll
    atk-sharp.dll
    atksharpglue-2.dll
    bzip2.dll
    Cecil.Decompiler.dll
    Cecil.Decompiler.pdb
    charset.dll
    freetype6.dll
    gdk-pixbuf-query-loaders.exe
    gdk-sharp.dll
    gdksharpglue-2.dll
    gettextlib.dll
    gettextpo.dll
    gettextsrc.dll
    glade-sharp.dll
    gladesharpglue-2.dll
    glib-sharp.dll
    glibsharpglue-2.dll
    gspawn-win32-helper.exe
    gtk-dotnet.dll
    gtk-query-immodules-2.0.exe
    gtk-sharp.dll
    gtksharpglue-2.dll
    iconv.dll
    ICSharpCode.SharpZipLib.dll
    intl.dll
    jpeg62.dll
    libatk-1.0-0.dll
    libcairo-2.dll
    libcroco-0.6-3.dll
    libexpat.dll
    libfontconfig-1.dll
    libgdk-win32-2.0-0.dll
    libgdk_pixbuf-2.0-0.dll
    libgio-2.0-0.dll
    libglade-2.0-0.dll
    libglib-2.0-0.dll
    libgmodule-2.0-0.dll
    libgobject-2.0-0.dll
    libgsf-1-114.dll
    libgsf-win32-1-114.dll
    libgthread-2.0-0.dll
    libgtk-win32-2.0-0.dll
    libpango-1.0-0.dll
    libpangocairo-1.0-0.dll
    libpangoft2-1.0-0.dll
    libpangowin32-1.0-0.dll
    libpixman-1-0.dll
    libpng12-0.dll
    libpng12.dll
    libpng13.dll
    libpopt-0.dll
    librsvg-2-2.dll
    libtiff3.dll
    libxml2-2.dll
    libxml2.dll
    mdhost.exe
    mdhost.pdb
    mdmonitor.exe
    mdmonitor.pdb
    mdrun.exe
    mdrun.exe.config
    mdrun.pdb
    Mono.Addins.CecilReflector.dll
    Mono.Addins.dll
    Mono.Addins.Gui.dll
    Mono.Addins.Setup.dll
    Mono.Cairo.dll
    Mono.Cecil.dll
    Mono.Cecil.Mdb.dll
    Mono.Cecil.Mdb.pdb
    Mono.Cecil.pdb
    Mono.Debugging.dll
    Mono.Debugging.pdb
    Mono.GetOptions.dll
    Mono.Posix.dll
    Mono.TextEditor.dll
    Mono.TextEditor.dll.config
    Mono.TextEditor.pdb
    MonoDevelop.Core.dll
    MonoDevelop.Core.dll.config
    MonoDevelop.Core.pdb
    MonoDevelop.exe
    MonoDevelop.exe.addins
    MonoDevelop.exe.config
    MonoDevelop.Ide.dll
    MonoDevelop.Ide.pdb
    MonoDevelop.pdb
    MonoDevelop.Projects.Formats.MSBuild.exe
    MonoDevelop.Projects.Formats.MSBuild.pdb
    monodoc.dll
    MonoPosixHelper.dll
    NRefactory.dll
    NRefactory.pdb
    pango-querymodules.exe
    pango-sharp.dll
    pangosharpglue-2.dll
    UnitTests.dll
    UnitTests.pdb
    zlib1.dll

    Addins/BackendBindings folder content----------------------------------

    Boo
    MonoDevelop.CSharpBinding.AspNet.dll
    MonoDevelop.CSharpBinding.AspNet.pdb
    MonoDevelop.CSharpBinding.Autotools.dll
    MonoDevelop.CSharpBinding.Autotools.pdb
    MonoDevelop.CSharpBinding.dll
    MonoDevelop.CSharpBinding.pdb
    MonoDevelop.DocFood.dll
    MonoDevelop.DocFood.pdb
    MonoDevelop.VBNetBinding.dll
    MonoDevelop.VBNetBinding.pdb
    MonoDevelop.XmlEditor.dll
    MonoDevelop.XmlEditor.pdb
    UnityScript

    Not so complicated, just delete what is not on the list above :)
     
  22. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    I deleted all the files that were not in the lists above but it didn't help.
    When I check the log.txt (in C:\Users\myUserName\AppData\Roaming\MonoDevelop) I still see lots of errors. See attachment.

    Anyone known what is going wrong?

    Btw I'm using Windows 7 64bit
     

    Attached Files:

  23. hjbaard

    hjbaard

    Joined:
    Feb 5, 2010
    Posts:
    38
    I found the solution. The make MonoDevelop work you need to install GTK for .NET (if you're using windows).
    You can find it here: http://monodevelop.com/Download
     
  24. roychr

    roychr

    Joined:
    Jun 16, 2009
    Posts:
    33
    Ok,

    The Boo folder must be deleted if you are using C# in \MonoDevelop\Addins\BackendBindings else try to remove conflicting files.

    As a side note to when you developers will release an install you should ask what language we will use or find a way for all of them to co-exist or you should rename your files so there is no conflicts. I am pretty sure no one will change the language anyway if a company has invested lots of energy in one.

    Follow the instruction on how to debug found earlier in the post. Oh the joy I feel now...
     
  25. PrvtHudson

    PrvtHudson

    Joined:
    Apr 10, 2009
    Posts:
    236
    I did the dll cleansing and set the preference. The ide opens up ok and I can set breakpoints. When I go to run/run however, I get no options, where I should get "Unity Debugger".

    9. Run->Run With->Unity Debugger
    10. The UnityEditor should open up
     

    Attached Files:

  26. roychr

    roychr

    Joined:
    Jun 16, 2009
    Posts:
    33
    It would seem upon rebooting the machine the monodevelop has stopped working... this is strange. So it worked only one night for me !

    Now i feel lonely...
     
  27. PrvtHudson

    PrvtHudson

    Joined:
    Apr 10, 2009
    Posts:
    236
    I got mine working by doing deleting the duplicates, deleting the ..\Roaming\MonoDevelop entry, and disabling UAC. I left BOO in.
     
  28. JAMiller

    JAMiller

    Joined:
    Apr 2, 2009
    Posts:
    73
    I can't seem to get this working. I tried from scratch several times deleting all the files I didn't see from that list (so much comparing back and forth I'm sure I made some mistakes). My log.txt is like 15 pages long of errors. I give up, mustn't waste any more of my Sunday!

    Could anyone offer a .zip of the version that works instead? Or maybe a .bat file that deletes the right files that we can just run?

    I guess it's back to UnityDevelop for now!
     
  29. PrvtHudson

    PrvtHudson

    Joined:
    Apr 10, 2009
    Posts:
    236
    What are the symptoms? Does it load or die on the splash screen?
     
  30. roychr

    roychr

    Joined:
    Jun 16, 2009
    Posts:
    33
    I had both monoDevelop and mono and libs installed prior to this, so desinstalling it helped. And i did a file to file perfect match of the files listed above in a previous post and trust me it works, you just have to take the time to check for each and if its not there remove it. When i did the file check with monodevelop installed it simply crashed, on uninstalling it, it probably removed the mono assemblys in the system files. Now that forces the application to load the one in the folders instead of the system folder.
     
  31. LordsWarrior

    LordsWarrior

    Joined:
    Jun 3, 2009
    Posts:
    58
    Im having same problem.

    Was the b3 monodevelop.zip different from the b4 one?
    I didnt download the b4 one..and now I cant get back to its upgrade page :? (checking for updates doesnt send me there.)

    -LW
     
  32. giyomu

    giyomu

    Joined:
    Oct 6, 2008
    Posts:
    1,090
    I installed the new beta and so the mono develop that come with and all work in first pass without do nothing esle than simple install, so for those who have trouble , if you didn't download the b4 yet , give it a try it should fix all that, at least it did for me.
     
  33. mythicwave

    mythicwave

    Joined:
    Jul 13, 2008
    Posts:
    144
    I installed beta 5 along with MonoDevelop on Windows XP. I followed the instructions, configured it correctly, created a solution, etc. MonoDevelop runs fine but when I try to launch Unity, it hangs and Unity never launches.
     
  34. PrvtHudson

    PrvtHudson

    Joined:
    Apr 10, 2009
    Posts:
    236
    I had the same thing. I rebooted and then started Unity without monoDevelop and then ... started it with monoDevelop and it worked. I assumed some .dll was resident from running Beta4.
     
  35. mythicwave

    mythicwave

    Joined:
    Jul 13, 2008
    Posts:
    144
    That doesn't work for me. It still hangs. Maybe it's because I have Unity 2.6 and 3 on the same machine. Although I've configured MonoDevelop to launch the Unity 3 executable.

    -- Brian
     
  36. mythicwave

    mythicwave

    Joined:
    Jul 13, 2008
    Posts:
    144
    Ok, I got it to work, but not the way described in the instructions.

    If I use Run->Run With->Unity Debugger, it hangs and never launches Unity.

    If I use Run->Debug, it works.

    By the way, will the debugger work with Javascript or just C#?

    -- Brian
     
  37. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Debugging works with JavaScript as well.
     
  38. volk

    volk

    Joined:
    Dec 5, 2009
    Posts:
    3
    I've had the same problem with beta5, the quoted solution worked perfectly, thanks!
     
  39. ranza

    ranza

    Joined:
    May 8, 2009
    Posts:
    44
    hello,
    Will it be also possible to debug scripts using VS ?