Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting multiple breakpoint in Visual Studio 2012 [duplicate]

I would like to set breakpoint all Convert.ToInt32 lines.

I have tried to replace all Convert.ToInt32 to System.Diagnostics.Debugger.Break(); Convert.ToInt32 but it did not work because some of the Convert.ToInt32 methods are parameter. So I wrote a regex replacement which insert the System.Diagnostics.Debugger.Break(); at the begining of the all Convert.ToInt32 lines. It seems working but is there any easy way of doing this?

ps: I do not think "Debug -> New Breakpoint -> Break at Function" works with System methods.

Update: I have written a small code

class Program
{
    private static void Main(string[] args)
    {
        int test = System.Convert.ToInt32("x");

        System.Console.Write(test);
    }
}

I have changed my "Tools -> Options -> Debugging" settingsTools -> Options -> Debugging

But it is still not working enter image description here

like image 432
ogun Avatar asked Nov 02 '22 20:11

ogun


1 Answers

Turn off the "Enable Just My Code" setting in the Debugging configuration and Enable .net framework source stepping. Now you can add Break at Function option

like image 106
Damith Avatar answered Nov 09 '22 16:11

Damith