Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug MSBuild Customtask

I'm trying to debug the MSBuild Customtask, that I have just created, but for some reason it never stops at the breakpoint. I've even tried this:

    public override bool Execute()
    {
        System.Diagnostics.Debugger.Break();

And added a break point on that line... I even eliminated all the other code in the method and that didn't change anything.

Is there anything special required to be able to debug the creation of custom tasks for MSBuild ?

like image 264
CheGueVerra Avatar asked Dec 10 '08 20:12

CheGueVerra


1 Answers

It's a bit of a hack, but you could always just put this line of code wherever it is that you want to start debugging:

System.Diagnostics.Debugger.Launch();

When you invoke it, the CLR will launch a dialog asking you what debugger you want to attach.

like image 51
Joel Martinez Avatar answered Oct 22 '22 17:10

Joel Martinez