[Mono-list] Debugging mono dll loaded by Unity3d

Steve Lessard s_lessard at yahoo.com
Sat Jul 17 14:02:25 EDT 2010


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.rushby at 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 at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list


More information about the Mono-list mailing list