#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
Cộng tác với chúng tôi trên GitHub
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho