I have a function which should only be used by a developer in special circumstances.
Unfortunately setting public / private doesn't really help, as it needs to be visible for use in many cases.
I have documented the function with xmldocs to give the developer a warning, but is it possible to output a compiler warning? Perhaps using an attribute, similar to marking a function as obsolete?
Or perhaps if someone has any useful architectural advice on steering people away from dangerous methods (i'm guessing this will probably be separate namespaces, inheritance etc?)
ADDITIONAL DETAIL
Thanks for the answers guys, lots of 1+'s from me :-)
It's also helped me clarify my question:
[Obsolete("my message")] is better in some ways to #warning, as it will only display a warning if the method is actually being used. However as ChrisF points out, it isn't actually an Obsolete method, so isn't really accurate.
Is there a middle ground between the functionality of [Obsolete("my message")] but without the meaning?