Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Any equivalent to debug.assert?

Reply
Thread Tools

Any equivalent to debug.assert?

 
 
Brian Cryer
Guest
Posts: n/a
 
      04-30-2007
It would be very handy to be able to stop the debugger on parts of code
without having to explicitly set a breakpoint - either a "debugger.break" or
"debug.assert" type of thing would do. I've not come across anything, but is
there anything in (VB).NET that would allow me to do this?

TIA.
--
Brian Cryer
www.cryer.co.uk/brian


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      04-30-2007
re:
!> is there anything in (VB).NET that would allow me to do this?

No, there isn't any native support for debug.assert,
but you can roll your own version quite easily, thanks to Dr. DotNetsky:

http://www.eggheadcafe.com/PrintSear...asp?LINKID=573

Compile the code in that page to an assembly, place the assembly in the
bin directory of your app, and add the Assert Handler to your app in Global.asax,
per the code supplied.

Voila! You have a debug.assert handler.

It will only fire in Debug mode and when running in localhost.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Brian Cryer" <> wrote in message
news:eKNYR%...
> It would be very handy to be able to stop the debugger on parts of code without having to
> explicitly set a breakpoint - either a "debugger.break" or "debug.assert" type of thing would do.
> I've not come across anything, but is there anything in (VB).NET that would allow me to do this?
>
> TIA.
> --
> Brian Cryer
> www.cryer.co.uk/brian
>
>



 
Reply With Quote
 
 
 
 
Brian Cryer
Guest
Posts: n/a
 
      04-30-2007
Thank you Juan.

This is great.

Since mostly I want to break on some of my exception handling I can probably
simply add:
If System.Diagnostics.Debugger.IsAttached Then
System.Diagnostics.Debugger.Break()
End If


but I wouldn't have found it except for you posting the link (and I'll
probably import it in full later). Thank you.


"Juan T. Llibre" <> wrote in message
news:...
> re:
> !> is there anything in (VB).NET that would allow me to do this?
>
> No, there isn't any native support for debug.assert,
> but you can roll your own version quite easily, thanks to Dr. DotNetsky:
>
> http://www.eggheadcafe.com/PrintSear...asp?LINKID=573
>
> Compile the code in that page to an assembly, place the assembly in the
> bin directory of your app, and add the Assert Handler to your app in
> Global.asax,
> per the code supplied.
>
> Voila! You have a debug.assert handler.
>
> It will only fire in Debug mode and when running in localhost.
>
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> "Brian Cryer" <> wrote in message
> news:eKNYR%...
>> It would be very handy to be able to stop the debugger on parts of code
>> without having to explicitly set a breakpoint - either a "debugger.break"
>> or "debug.assert" type of thing would do. I've not come across anything,
>> but is there anything in (VB).NET that would allow me to do this?
>>
>> TIA.
>> --
>> Brian Cryer
>> www.cryer.co.uk/brian



 
Reply With Quote
 
Jon Paal [MSMD]
Guest
Posts: n/a
 
      04-30-2007
google:

debug.assert asp.net


"Brian Cryer" <> wrote in message news:eKNYR%...
> It would be very handy to be able to stop the debugger on parts of code without having to explicitly set a breakpoint - either a
> "debugger.break" or "debug.assert" type of thing would do. I've not come across anything, but is there anything in (VB).NET that
> would allow me to do this?
>
> TIA.
> --
> Brian Cryer
> www.cryer.co.uk/brian
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
IS THERE ANY EQUIVALENT TO DISPOSE()? abenm613@mail.ru Java 7 12-13-2005 02:25 AM
Any Eclipse equivalent to WSAD server perspective? Jay Eckles Java 1 02-19-2004 08:39 AM
Any one got a Packard bell IGO 3491 or the NEC equivalent with these specs????? Dooby Computer Support 8 10-02-2003 06:12 AM
Any equivalent of #include in HTML? Ed B. Norton Computer Support 4 07-06-2003 05:53 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57