Re: [Mono-list] Debugging mono dll loaded by Unity3d
Thank you both for your replies. I did try the approach Steve advised and I can see how it would work if the Unity 3d executable supported loading in debug mode. I will therefore wait until I can get hold of a copy of Unity 3 as Michael recommended. Thanks again, Andy -- View this message in context: http://mono.1490590.n4.nabble.com/Debugging-mono-dll-loaded-by-Unity3d-tp2291591p2293670.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Debugging mono dll loaded by Unity3d
Instead of attaching to the exe that references your dll have MonoDevelop launch the exe for you. The trick to getting MonoDevelop to launch the exe for you is to create an empty project with the same name as your exe (minus the .exe extension) and add it to the same solution as your dll project. Set that empty project as the startup project. In the directory for the empty project create the bin\Debug directories and copy your exe, exe.mdb, config, etc. files there. Now build the entire solution and select Debug from the Run menu. MonoDevelop will launch your exe in the debugger and should be able to break at breakpoints within your dll project. -SteveL On Jul 16, 2010, at 9:04 AM, and192 andrew.rus...@googlemail.com wrote: Hi there, I have a problem trying to understand how to debug a library I'm writing in MonoDevelop. This library is being referenced from a Unity3d project. I have been pointing the MonoDevelop debugger at the built Unity3d exe and hoping to be able to 'attach' along the lines of the MSVisual studio debugger. However the debugger loads in MonoDevelop and encounters an exception: System.Runtime.InteropServices.COMException (0x80131700): Failed to load the runtime. at Microsoft.Samples.Debugging.CorDebug.NativeMethods.GetRequestedRuntimeVersion etc... I suspect this is because Unity3d is not a mono executable and the Mono debugger cannot detect the runtime version. I appreciate there may not be an easy way to do this, but before I give up, does anyone have any suggestions, other than writing to debug log files etc, on how I can use a debugger to step through my mono code? Many thanks in advance, Andy -- View this message in context: http://mono.1490590.n4.nabble.com/Debugging-mono-dll-loaded-by-Unity3d-tp2291591p2291591.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Debugging mono dll loaded by Unity3d
On Fri, Jul 16, 2010 at 12:04 PM, and192 andrew.rus...@googlemail.com wrote: Hi there, I have a problem trying to understand how to debug a library I'm writing in MonoDevelop. This library is being referenced from a Unity3d project. I have been pointing the MonoDevelop debugger at the built Unity3d exe and hoping to be able to 'attach' along the lines of the MSVisual studio debugger. However the debugger loads in MonoDevelop and encounters an exception: System.Runtime.InteropServices.COMException (0x80131700): Failed to load the runtime. at Microsoft.Samples.Debugging.CorDebug.NativeMethods.GetRequestedRuntimeVersion etc... That's the .NET debugging addin - it cannot debug Mono apps. To use the Mono debugger, your target runtime should be Mono. However... I suspect this is because Unity3d is not a mono executable and the Mono debugger cannot detect the runtime version. I appreciate there may not be an easy way to do this, but before I give up, does anyone have any suggestions, other than writing to debug log files etc, on how I can use a debugger to step through my mono code? The Mono Soft debugger does not support attaching to arbitrary runtimes. You must use Mono 2.6+, and the apps must be started in debuggable mode, which MD does automatically using Mono runtime commandline arguments when starting the app. For apps that embed the Mono runtime, such as Unity, you need a (trivial) MD addin to tell it how to launch the app. Also, the embedding host must support enabling debugging, and must use Mono 2.6+. For this, you'll need Unity 3.0. -- Michael Hutchinson http://mjhutchinson.com ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Debugging mono dll loaded by Unity3d
Hi there, I have a problem trying to understand how to debug a library I'm writing in MonoDevelop. This library is being referenced from a Unity3d project. I have been pointing the MonoDevelop debugger at the built Unity3d exe and hoping to be able to 'attach' along the lines of the MSVisual studio debugger. However the debugger loads in MonoDevelop and encounters an exception: System.Runtime.InteropServices.COMException (0x80131700): Failed to load the runtime. at Microsoft.Samples.Debugging.CorDebug.NativeMethods.GetRequestedRuntimeVersion etc... I suspect this is because Unity3d is not a mono executable and the Mono debugger cannot detect the runtime version. I appreciate there may not be an easy way to do this, but before I give up, does anyone have any suggestions, other than writing to debug log files etc, on how I can use a debugger to step through my mono code? Many thanks in advance, Andy -- View this message in context: http://mono.1490590.n4.nabble.com/Debugging-mono-dll-loaded-by-Unity3d-tp2291591p2291591.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list