coolwaterxii
coolwaterxii

Reputation: 41

MonoDevelop: How to start debug from Add-In

I'm trying to write a MonoDevelop Add-In that will start debugging. Basically, will invoke File -> Start Debugging. How can I do that?

Thanks!

Upvotes: 0

Views: 46

Answers (1)

SushiHangover
SushiHangover

Reputation: 74144

Something like this will start debugging on the current target:

IBuildTarget target = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
var operation = IdeApp.ProjectOperations.CheckAndBuildForExecute (target);
operation.Completed += delegate {
if (operation.Success)
    IdeApp.ProjectOperations.Debug (target);
};

Note: The .Debug method is an extension method so make sure that you include MonoDevelop.Debugger in your refs/using otherwise it will not be found...

Upvotes: 1

Related Questions