Snowing Code

Personal notes on software development

Running and Debugging MonoDevelop Add-Ins in MonoDevelop

(Publish date: 30/05/2012)

So you've decided to give MonoDevelop a go and what would be a better way to start than writing your very own MonoDevelop Add-in? However, seeing that an add-in takes the format of a class library, you'll need to run it through MonoDevelop in order to debug it; this post will be a short explanation on how to do this.

Open your addin solution in MonoDevelop, go to the solution view and right click on the project. Select options and then under Run select Custom Commands. From the '(select a project operation)' drop down select Execute, then in the Command box browse to the folder where the MonoDevelop.exe that you wish to use sits. This quite simply tells MD to run the current project with the MD executable whenever you hit start debugging.
So now that we've got that sorted, all that's left is just to make sure that your addin will actually be picked up by MonoDevelop and loaded whenever you start debugging. MonoDevelop extensibility works in such a way that whatever you have under the MonoDevelop/Addins folder. If you go to that folder you could see folderrs such as NUnit and VersionControl- 2 of MonoDevelops' add-ins. Create a folder for your new addin in there (for example MonoDevelop.AwsomeAddin) and then in Options, under Debug select Output and in Outputt path insert the path to your new foler %MD_LOCATION%/MonoDevelop/Addins/MonoDevelop.AwesomeAddin And there you go. This last configuration will tell Monodevelop to dump your dll and all other built files into that folder so that whenever you start debugging, MonoDevelop will see that under Addins/MonoDevelop.AwesomeAddin you have a dll that extends MD.
I also have a small script to remove the content of this folder and then open my solution in MD and use it instead of openning MD directly, so that I never open an instance of MD to develop my addin while using it. This will prevent you from building your solution since your dlls are in use.

Hope this helps!
blog comments powered by Disqus