In c# I can mark some functions as obsolete by doing
[Obsolete]
void Foo()
{}
this tell the compiler to throw warning if I am using this function.
I want to create my own tag [Experimental] which just as obsolete throw a warning telling the user who build the code that this function is not well tested and using it may result in troubles.
Is it possible to do this? How?
I want to create my own attribute
[Experimental]
which just as[Obsolete]
does makes the compiler produce a warning. Is it possible to do this?
No, sorry. Obsolete
is a very special attribute. The compiler has special-purpose code written for it. There is no extensible warning mechanism in C#.
If you would like to submit this suggestion to the Visual Studio team, you can do that at http://visualstudio.uservoice.com/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With