Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining

Directives (Visual Basic)

The topics in this section document the Visual Basic source code compiler directives.

#Const Directive -- Define a compiler constant

#ExternalSource Directive -- Indicate a mapping between source lines and text external to the source

#If...Then...#Else Directives -- Compile selected blocks of code

#Region Directive -- Collapse and hide sections of code in the Visual Studio editor

#Disable, #Enable -- Disable and enable specific warnings for regions of code.

#Disable Warning BC42356 ' suppress warning about no awaits in this method
    Async Function TestAsync() As Task
    End Function
#Enable Warning BC42356

You can disable and enable a comma-separated list of warning codes too.

© 2015 Microsoft