471,330 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Debugger.Break() and Abort/Retry/Ignore

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
Jul 21 '05 #1
5 1732
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

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

"rawCoder" <ra******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
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

Jul 21 '05 #2
Assuming C# is the issue

#if DEBUG
Debugger.Break();
#endif

is the correct version

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
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

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

"rawCoder" <ra******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
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

Jul 21 '05 #3
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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
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

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

"rawCoder" <ra******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
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

Jul 21 '05 #4
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.

"rawCoder" <ra******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
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

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

"rawCoder" <ra******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
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


Jul 21 '05 #5
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

"rawCoder" <ra******@hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
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

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Ziaran _ | last post: by
16 posts views Thread by Bill | last post: by
5 posts views Thread by rawCoder | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.