Debugger.Break() and Abort/Retry/Ignore

  • Thread starter Thread starter rawCoder
  • Start date Start date
R

rawCoder

On running a console app from Windows Server 2003 with Debugger.Break()
makes an Abort Retry Ignore popup appear stating that a user defined
breakpoint is reached.

Works the same in both Release and Debug Builds.

How to avoid this ?

Thank You
rawCoder
 
Hi,

Debugger.Break will attach a debugger to the app. If you dont want
it to go attach a debugger in release mode try this.

#If Debug Then

Debugger.Break()

#End If



Ken

------------------------

On running a console app from Windows Server 2003 with Debugger.Break()
makes an Abort Retry Ignore popup appear stating that a user defined
breakpoint is reached.

Works the same in both Release and Debug Builds.

How to avoid this ?

Thank You
rawCoder
 
No actually I would like that even if its a Debug version, the Debugger
Breaks in the IDE, BUT does nothing when its being run standalone as an
executable.

Seems like that is not possible, right ?

Thank You
rawCoder
 
It depends on what IDE you are using.
If you are using VS.NET, you can add breakpoint in the editor instead of
placing Debugger.Break() directly into code (add breakpoint by clicking on
the left side of the editor) and the execution will break only when run from
your application VS.NET.
 
Browsing through VS2005B2 i found the exact solution to my problem

If Debugger.IsAttached() then Debugger.Break()

Will break only if its being run from IDE and will do nothing if standalsone
executable is being run.

HTH
rawCoder
 
Back
Top