简体   繁体   中英

#warning directive in VB.net

I know the #warning directive does not exist in vb.net... is there anything like it?
I want to be able to throw messages (warnings) at compiler time.

就我所能找到的而言……不。

It's not the same as preprocessor warning, but in the most cases where I need a warning for the user I generate one using the ObsoleteAttribute:

<ObsoleteAttribute("You should no used this method!", False)> Sub MySub() End Sub

However, since it is not the same as a preprocessor warning it will only trigger if someone uses the methode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM