469,331 Members | 5,240 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

Debug.Assert( False, "Why wont I display ??")

Debug.Assert( False, "Why wont I display ??")

I am trying to use this in my code but it wont display. The app is running
on my local machine and the above code under a button click event.

What am I missing ?

Cheers mr N . . .
Nov 19 '05 #1
5 2256
The syntax is :

Debug.Assert Method (Boolean, String)
Checks for a condition and displays a message if the condition is false.

Example :

Public Shared Sub MyMethod(type As Type, baseType As Type)
Debug.Assert(Not (type Is Nothing), "Type parameter is null")
End Sub

What's the method/condition you're testing ?

http://msdn.microsoft.com/library/de...serttopic1.asp

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/
======================================
"Mr Newbie" <he**@now.com> wrote in message news:Or**************@TK2MSFTNGP15.phx.gbl...
Debug.Assert( False, "Why wont I display ??")

I am trying to use this in my code but it wont display. The app is running on my local
machine and the above code under a button click event.

What am I missing ?

Cheers mr N . . .

Nov 19 '05 #2
Yes I know, thats my example but it does not work. I'm simply trying to get
the line to work and display the dialog box on my local server if the
assertion failed, but it does naff all and simply goes about its business
without so much as a sneeze !!!
Cheers Mr N


"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
The syntax is :

Debug.Assert Method (Boolean, String)
Checks for a condition and displays a message if the condition is false.

Example :

Public Shared Sub MyMethod(type As Type, baseType As Type)
Debug.Assert(Not (type Is Nothing), "Type parameter is null")
End Sub

What's the method/condition you're testing ?

http://msdn.microsoft.com/library/de...serttopic1.asp

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/
======================================
"Mr Newbie" <he**@now.com> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
Debug.Assert( False, "Why wont I display ??")

I am trying to use this in my code but it wont display. The app is
running on my local machine and the above code under a button click
event.

What am I missing ?

Cheers mr N . . .


Nov 19 '05 #3
"Mr Newbie" <he**@now.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Yes I know, thats my example but it does not work. I'm simply trying to
get the line to work and display the dialog box on my local server if the
assertion failed, but it does naff all and simply goes about its business
without so much as a sneeze !!!


I don't know anything about Debug.Assert, but does it only work in debug
mode, and you're not debugging?
Nov 19 '05 #4
Debug.Assert doesn't work very well for asp.net applications. You need to
check the VS.Net output window and run the code from VS.Net. Not very
practicaly. Supposedly you can do stuff to fix it, like:
http://www.vbinfozine.com/t_aspnetassert.shtml

but I've never tried.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Danny Tuppeny" <gr****@dannytuppeny.commmmmm> wrote in message
news:43***********************@ptn-nntp-reader03.plus.net...
"Mr Newbie" <he**@now.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Yes I know, thats my example but it does not work. I'm simply trying to
get the line to work and display the dialog box on my local server if the
assertion failed, but it does naff all and simply goes about its business
without so much as a sneeze !!!


I don't know anything about Debug.Assert, but does it only work in debug
mode, and you're not debugging?

Nov 19 '05 #5
OK, thanks for your help Karl.

Much appreciated.
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:up*************@TK2MSFTNGP10.phx.gbl...
Debug.Assert doesn't work very well for asp.net applications. You need to
check the VS.Net output window and run the code from VS.Net. Not very
practicaly. Supposedly you can do stuff to fix it, like:
http://www.vbinfozine.com/t_aspnetassert.shtml

but I've never tried.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Danny Tuppeny" <gr****@dannytuppeny.commmmmm> wrote in message
news:43***********************@ptn-nntp-reader03.plus.net...
"Mr Newbie" <he**@now.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Yes I know, thats my example but it does not work. I'm simply trying to
get the line to work and display the dialog box on my local server if
the assertion failed, but it does naff all and simply goes about its
business without so much as a sneeze !!!


I don't know anything about Debug.Assert, but does it only work in debug
mode, and you're not debugging?


Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Smith | last post: by
1 post views Thread by John Holmes | last post: by
2 posts views Thread by Jeremy S. | last post: by
3 posts views Thread by Whiplash | last post: by
10 posts views Thread by Paul Rubin | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.