Conditional Compilation

  • Thread starter Thread starter Robin Tucker
  • Start date Start date
R

Robin Tucker

Is there a #define equivalent for VB.NET? I'm wanting to begin
implementation of a new feature in my software, but to hide it in release
builds until it's ready. Any ideas?
 
Is there a #define equivalent for VB.NET? I'm wanting to begin
implementation of a new feature in my software, but to hide it in release
builds until it's ready. Any ideas?

If all you want to do is differentiate between debug and release versions,
then:

#If DEBUG Then
' stuff you want to hide
#End If
 
Ahhh superb. Thanks.

AMercer said:
If all you want to do is differentiate between debug and release versions,
then:

#If DEBUG Then
' stuff you want to hide
#End If
 
Robin,
In addition to #If DEBUG Then

There is also a Conditional attribute which I find handy.

<Conditional("DEBUG")> _
Public Sub Test()
End Sub

The Test sub will always be created, however it will conditionally be called
based on whether its a DEBUG build or not.

http://msdn.microsoft.com/library/d...diagnosticsconditionalattributeclasstopic.asp

http://msdn.microsoft.com/library/d.../en-us/csspec/html/vclrfcsharpspec_17_4_2.asp

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Is there a #define equivalent for VB.NET? I'm wanting to begin
| implementation of a new feature in my software, but to hide it in release
| builds until it's ready. Any ideas?
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top