JZ,
In addition to "#if DEBUG" as the other suggest, check out
System.Diagnost ics.Conditional Attribute. It allows to define a routine that
will only be called in a specific build.
<Conditional("D EBUG")> _
Public Sub CalledOnlyInDeb ugBuilds()
End Sub
<Conditional("T RACE")> _
Public Sub CalledOnlyInTra ceBuilds()
End Sub
If the DEBUG or TRACE conditional compilation constants are not defined
(such as DEBUG in Release builds) the above calls are treated as nops.
Its how Debug.WriteLine & Trace.WriteLine are implemented.
Hope this helps
Jay
"JZ" <jj@anon.anon.c om> wrote in message
news:41******** **************@ news-text.dial.pipex .com...
Hi,
Is there anyway to mark a block of code so that it will only run in debug
mode?
Like a # debug region ?
Thanks,
--
JZ