#Disable and #Enable directives (Visual Basic)
The #Disable
and #Enable
directives are Visual Basic source code compiler directives. They are used to disable and re-enable all or specific warnings for regions of code.
Dim variable1 'warning BC42024: Unused local variable: 'variable1'.
#Disable Warning
Dim variable2 'no warning
#Enable Warning
Dim variable3 'warning BC42024: Unused local variable: 'variable3'.
' Suppress warning about no awaits in this method.
#Disable Warning BC42356
Async Function TestAsync() As Task
Console.WriteLine("testing")
End Function
#Enable Warning BC42356
You can also disable and enable a comma-separated list of warning codes.
See also
Spolupráca s nami v službe GitHub
Zdroj tohto obsahu nájdete v službe GitHub, kde môžete vytvárať a skúmať problémy a žiadosti o prijatie zmien. Ďalšie informácie nájdete v našom sprievodcovi prispievateľom.
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre