Node Copied to Clipboard!

How-to Articles

How to debug custom DLLs in Visual Studio or MonoDevelop

In order to debug your DLL with Visual Studio or MonoDevelop (for example, so that you can set breakpoints), you need to follow these instructions

Note: It is assumed here that you've followed all the instructions in this article. Also note that this feature only applies to the desktop version of Modest3D.

Step 1: Download a special build of Modest3D where debugging is allowed

This build can be found here.

Step 2: Copy the PDB file to your project every time the DLL is changed

Whenever you build your DLL, there should be a PDB generated alongside it. For example, if my DLL is called Foo.dll, then there needs to be a file named Foo.pdb next to it in your project directory. If using the offline version of Modest3D, the most convenient way to do this might be to set your OutputPath directly to your Modest3D project, or possibly set up a post-build step to automatically copy the DLL and the PDB file

Step 3: Attach Visual Studio / MonoDevelop to Modest3D

If using MonoDevelop, click the menu item Run -> Attach To Process. Then select the row WindowsPlayer

If using Visual Studio, download Visual Studio Tools For Unity. Then with your project open, select Debug -> Attach Unity Debugger. Then select WindowsPlayer

Step 4: Set breakpoint

In Modest3D, add nodes to the storyboarder which call methods in your DLL. Then add a breakpoint in that method. Then hit Play. Your breakpoints should now be hit!