Dmitry Romanov
Dmitry Romanov

Reputation: 14090

Disable debugger auto break on application start

Visual studio 2010 debugger automatically set breakpoint at the beginning of Main() on application start (C# project). So each time I start application in the debug mode it paused at the beginning. Please suggest how to disable it.

update:
- I definitely hit "Start debugging (F5)" and NOT "Step into new Instance (F10)". Use F5 key or menu
- There in definitely no breakpoint
- It is simple and usual Main method:

    [STAThread]
    private static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new ExpertEntryForm());
    }

P.S. It is funny, but I really can't find (and google) this checkbox!


Solution

Indeed it was a stale breakpoint which didn't show up in breakpoint list and editor but was activated each application start.
Solve it by:
1. Add a new breakpoint somewhere. (So there is at least one breakpoint in breakpoints list)
2. Press Debug->Delete all breakpoints

So leppie's suggestion should work too.

Upvotes: 4

Views: 779

Answers (2)

leppie
leppie

Reputation: 117220

Delete your *.user files.

Might be a stale breakpoint failing to show up.

You can try looking at the breakpoints too in Debug > Breakpoints.

Upvotes: 3

StyxRiver
StyxRiver

Reputation: 2245

Are you starting the application in debug (F5) or Stepping Into the application (F10)?

If you're using F10, you will always start at the beginning of Main(). F5 will run the application until it encounters the first breakpoint.

Upvotes: 2

Related Questions